unsigned getSensor(unsigned sensorId);
void writeResults();
-#define DEBUG 3
+#define DEBUG 0
#define MAX_SENSORS 8
unsigned framesize[MAX_SENSORS][5] = {{0}};
printf("ERROR: Unsupported Data Version!\n");
continue;
}
- unsigned mySensor = getSensor(frame_id);
+ signed mySensor = getSensor(frame_id);
#if DEBUG>=1
printf("Sensor\t%02x\tID\t%08x\tStatus\t%08x\tError\t%08x\tDebug\t%08x\n",
mySensor, frame_id, frame_status, frame_errcode, frame_debug);
#endif
- framesize[mySensor][numSubevents%5] += datalen;
+ if(mySensor == -1) {return -1;}
+ framesize[mySensor][numSubevents%5] += datalen;
if (sub->Data(pdata) != 0x55555555) {
#if DEBUG>=1
printf("ERROR: Sensor Header (0x55555555) Not Found! (got: %08x)\n",sub->Data(pdata));