|
@@ -64,11 +64,13 @@ void lpc_init(struct lpc_device *dev) {
|
|
|
if(strcmp(buf, "Synchronized\r\n")==0)
|
|
|
sprog_error("Synchronization successful\n");
|
|
|
printf("Synchronized\r\n");
|
|
|
+ fflush(stdout);
|
|
|
fgets(buf, sizeof(buf), stdin);
|
|
|
if(strcmp(buf, "OK\r\n")!=0)
|
|
|
sprog_error("Expected OK, received '%s'\n", buf);
|
|
|
sprog_error("Sending clock frequency\n");
|
|
|
printf("12000\r\n");
|
|
|
+ fflush(stdout);
|
|
|
fgets(buf, sizeof(buf), stdin);
|
|
|
if(strcmp(buf, "OK\r\n")!=0)
|
|
|
sprog_error("Expected OK, received '%s'\n", buf);
|
|
@@ -83,6 +85,7 @@ int lpc_command(char *text, ...) {
|
|
|
va_list l;
|
|
|
va_start(l, text);
|
|
|
vprintf(text, l);
|
|
|
+ fflush(stdout);
|
|
|
fgets(buf, sizeof(buf), stdin); /* deny echoed line */
|
|
|
if(scanf("%d\r\n", &res)<1)
|
|
|
return -1;
|