I am baffled by the behavior of my sketch. It's relatively large, so I'll only post the relavant lines here:
uint32_t lateCounter = 0;
if ( (!timer_SampleRate.delayTillExpired()) )
printf("Late Counter updated to %d on sample %d\r\n", lateCounter, i);
printf("lateCount pre = %d\r\n", lateCounter);
samples = pMAX11206->maxGetADC();
- printf("lateCount post = %d\r\n", lateCounter);*
This is generating the following output:...
Late Counter updated to 1 on sample 5
lateCount pre = 1
lateCount post = 0
It's clear that the member function maxGetADC() is causing lateCount to be reset back to zero (I've tried just calling that method and it not doing anything). But from the code alone, that shouldn't be happening. >:( Does anyone have any clues as to how this could happen? If it's relavent, I'm using the visual micro plugin in visual studio 2013 to build a sketch for the Arduino Due.