Add ccdump
[fw/altos] / lib / cc-usb.c
index a85765af120d61aabe0421cc578108f4e98b94ad..09b06bb54054b2e71c2e5c8c7b4ea8b175fce2f0 100644 (file)
@@ -201,7 +201,7 @@ cc_usb_sync(struct cc_usb *cc)
        }
 }
 
        }
 }
 
-static void
+void
 cc_usb_printf(struct cc_usb *cc, char *format, ...)
 {
        char    buf[1024], *b;
 cc_usb_printf(struct cc_usb *cc, char *format, ...)
 {
        char    buf[1024], *b;
@@ -226,6 +226,7 @@ cc_usb_printf(struct cc_usb *cc, char *format, ...)
                memcpy(cc->out_buf + cc->out_count, b, this_time);
                cc->out_count += this_time;
                ret -= this_time;
                memcpy(cc->out_buf + cc->out_count, b, this_time);
                cc->out_count += this_time;
                ret -= this_time;
+               b += this_time;
                while (cc->out_count >= CC_BUF)
                        cc_usb_sync(cc);
        }
                while (cc->out_count >= CC_BUF)
                        cc_usb_sync(cc);
        }
@@ -250,7 +251,7 @@ cc_usb_send_bytes(struct cc_usb *cc, uint8_t *bytes, int len)
        return ret;
 }
 
        return ret;
 }
 
-static void
+void
 cc_queue_read(struct cc_usb *cc, uint8_t *buf, int len)
 {
        struct cc_read  *read_buf;
 cc_queue_read(struct cc_usb *cc, uint8_t *buf, int len)
 {
        struct cc_read  *read_buf;