indexOut incremented independent of outPos

This resolves issue #5
This commit is contained in:
David Madison 2017-03-28 01:03:25 -04:00
parent 672f401a4d
commit 91223e91e8
1 changed files with 3 additions and 3 deletions

View File

@ -171,16 +171,16 @@ void adalight(){
if (outPos < sizeof(leds)){ if (outPos < sizeof(leds)){
#ifdef CALIBRATE #ifdef CALIBRATE
if(outPos < 3) if(outPos < 3)
ledsRaw[outPos++] = buffer[indexOut++]; ledsRaw[outPos++] = buffer[indexOut];
else{ else{
ledsRaw[outPos] = ledsRaw[outPos%3]; // Sets RGB data to first LED color ledsRaw[outPos] = ledsRaw[outPos%3]; // Sets RGB data to first LED color
outPos++; outPos++;
indexOut++;
} }
#else #else
ledsRaw[outPos++] = buffer[indexOut++]; // Issue next byte ledsRaw[outPos++] = buffer[indexOut]; // Issue next byte
#endif #endif
} }
indexOut++;
bytesBuffered--; bytesBuffered--;
bytesRemaining--; bytesRemaining--;
} }