small bugfixes in debug, test-code

master
Paul Goeser 15 years ago committed by Dario Ernst
parent d3fcd7304d
commit 203cf52b1c

@ -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();

@ -26,6 +26,7 @@ char dbgReadChar() {
for(int i=0; i<dbgStrFill-1; i++) {
debugStr[i] = debugStr[i+1];
}
dbgStrFill--;
return ret;
} else {
return 0xFF;

@ -4,6 +4,8 @@
#include "i2c_simple.h"
#include "mcp_adc.h"
#include "debug.h"
uint8_t foo;
uint16_t bar;
uint16_t timertmp;
@ -71,6 +73,7 @@ int __attribute__((noreturn)) main(void) {
softinit();
muxer_set(MUXER_CHANNEL_0);
dbgLog("Hallo, Welt!\n");
temperatures[2]=33;
for(;;){

Loading…
Cancel
Save