fixed masterchip bug that broke usb-readout

master
Paul Goeser 15 years ago
parent 9e803b15fa
commit 94efdc1dc4

@ -17,7 +17,7 @@
#include "main.h"
uint8_t newThermoData = 1;
uint16_t thermoData[];
uint16_t thermoData[4];
void hardinit() {
@ -79,6 +79,7 @@ int __attribute__((noreturn)) main(void) {
uint16_t recv;
for(int i=0; i<4; i++) {
thermoData[i] = spi_master_transceive(7, i, 0);
usbPoll();
}
newThermoData = 1;
}

@ -13,17 +13,17 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) {
uint16_t recv;
if(rq->bRequest == 100) {
dataBuffer[0] = (thermoData [0] & 0xff00)>>8;
dataBuffer[1] = thermoData [0] & 0x00ff;
dataBuffer[2] = (thermoData [1] & 0xff00)>>8;
dataBuffer[3] = thermoData [1] & 0x00ff;
dataBuffer[0] = (thermoData[0] & 0xff00)>>8;
dataBuffer[1] = thermoData[0] & 0x00ff;
dataBuffer[2] = (thermoData[1] & 0xff00)>>8;
dataBuffer[3] = thermoData[1] & 0x00ff;
usbMsgPtr = dataBuffer;
return 4;
} else if(rq->bRequest == 101) {
dataBuffer[0] = (thermoData [2] & 0xff00)>>8;
dataBuffer[1] = thermoData [2] & 0x00ff;
dataBuffer[2] = (thermoData [3] & 0xff00)>>8;
dataBuffer[3] = thermoData [3] & 0x00ff;
dataBuffer[0] = (thermoData[2] & 0xff00)>>8;
dataBuffer[1] = thermoData[2] & 0x00ff;
dataBuffer[2] = (thermoData[3] & 0xff00)>>8;
dataBuffer[3] = thermoData[3] & 0x00ff;
usbMsgPtr = dataBuffer;
return 4;
} else {

Loading…
Cancel
Save