make sure row_offset and y do not overlap

This commit is contained in:
Josh Goebel 2017-04-17 20:02:02 -04:00 committed by Scott Allen
parent 6f9056f99c
commit 50df1a221b
1 changed files with 2 additions and 2 deletions

View File

@ -308,11 +308,11 @@ void Arduboy2Base::drawPixel(int16_t x, int16_t y, uint8_t color)
"adc r31, __zero_reg__\n"
// load correct bitshift from program RAM
"lpm %[bit], Z\n"
: [row_offset] "=a" (row_offset), // upper register (ANDI)
: [row_offset] "=x&" (row_offset), // upper register (ANDI)
[bit] "=r" (bit)
: [width_offset] "r" ((uint8_t)(WIDTH/8)),
[y] "a" ((uint8_t)y), // upper register (ANDI)
[x] "r" ((uint8_t)x),
[y] "a" ((uint8_t)y), // upper register (ANDI)
"z" (bitshift_left)
: "r1", "r0");