Sync USB data after each memory write command
[fw/altos] / cctools / lib / cc-usb.c
index dc764c24e99f79fd326226cbb8f795063ab58340..81309983fd46b7487aaba7cabc005051373322be 100644 (file)
@@ -282,6 +282,7 @@ cc_usb_write_memory(struct cc_usb *cc, uint16_t addr, uint8_t *bytes, int len)
        cc_usb_printf(cc, "O %x %x\n", len, addr);
        while (len--)
                cc_usb_printf(cc, "%02x", *bytes++);
+       cc_usb_sync(cc);
        return 0;
 }
 
@@ -343,7 +344,7 @@ cc_usb_open(char *tty)
        save_termios = termios;
        cfmakeraw(&termios);
        tcsetattr(cc->fd, TCSAFLUSH, &termios);
-       cc_usb_printf(cc, "E 0\n");
+       cc_usb_printf(cc, "E 0\nm 0\n");
        cc_usb_sync(cc);
        sleep(1);
        cc_usb_sync(cc);