diff loadtools/romload.c @ 250:8c011177adb9

loadtools reworked to use factored-out libserial
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 21 Sep 2017 23:07:01 +0000
parents e7502631a0f9
children aba969153d20
line wrap: on
line diff
--- a/loadtools/romload.c	Thu Sep 21 21:49:07 2017 +0000
+++ b/loadtools/romload.c	Thu Sep 21 23:07:01 2017 +0000
@@ -13,7 +13,7 @@
 #include <strings.h>
 #include <termios.h>
 #include <unistd.h>
-#include "baudrate.h"
+#include "../libserial/baudrate.h"
 #include "srecreader.h"
 
 extern int errno;
@@ -179,6 +179,7 @@
 
 	if (open_srec_file(&iramimage) < 0)
 		exit(1);
+	set_fixed_baudrate("19200");
 	ioctl(target_fd, FIONBIO, &zero);
 	send_beacons();
 	printf("Got beacon response, attempting download\n");
@@ -203,7 +204,7 @@
 	}
 	printf("<p command successful, switching to %s baud\n",
 		romload_baud_rate->name);
-	switch_baud_rate(romload_baud_rate);
+	set_serial_baudrate(romload_baud_rate);
 	usleep(SERIAL_FLUSH_DELAY * 1000);
 	tcflush(target_fd, TCIFLUSH);