diff --git a/cmdline/read-temp.c b/cmdline/read-temp.c index e635486..fffcd8b 100644 --- a/cmdline/read-temp.c +++ b/cmdline/read-temp.c @@ -147,24 +147,26 @@ int cnt, vid, pid; rxIndex = ((int)buffer[1] & 0xff) | (((int)buffer[0] & 0xff) << 8); if(rxIndex) { // if we have new data? - // get the new char and print it - rq = rqGetNew; + // advance the new char pointer... + rq = rqAdvance; cnt = usb_control_msg(handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, rq[0], rq[1], rq[2], buffer, sizeof(buffer), 5000); if(cnt < 0){ fprintf(stderr, "\nUSB error in iteration ?!?: %s\n", usb_strerror()); } rxIndex = ((int)buffer[1] & 0xff) | (((int)buffer[0] & 0xff) << 8); - fprintf(stderr, "%c", rxIndex); - // advance the new char pointer... - rq = rqAdvance; + // get the new char and print it + rq = rqGetNew; cnt = usb_control_msg(handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, rq[0], rq[1], rq[2], buffer, sizeof(buffer), 5000); if(cnt < 0){ fprintf(stderr, "\nUSB error in iteration ?!?: %s\n", usb_strerror()); } rxIndex = ((int)buffer[1] & 0xff) | (((int)buffer[0] & 0xff) << 8); + if(rxIndex != 0 && (rxIndex & 0xff) != 0xff){ + fprintf(stderr, "%c", rxIndex); + } } - usleep(10000); + usleep(1000); } } else { usage(); diff --git a/firmware/slavechip/debug.c b/firmware/slavechip/debug.c index 7c22bf9..5dcc9a8 100644 --- a/firmware/slavechip/debug.c +++ b/firmware/slavechip/debug.c @@ -26,6 +26,7 @@ char dbgReadChar() { for(int i=0; i