Fixed pixel setting in black and white graphics driver

This commit is contained in:
Silvano Seva 2020-10-22 22:00:01 +02:00 committed by Niccolò Izzo
parent 190548a0d0
commit 160b23f1b7
1 changed files with 2 additions and 1 deletions

View File

@ -122,7 +122,8 @@ void _bw_setPixel(point_t pos, bw_t bw)
*/
uint16_t cell = (pos.x + pos.y*screen_width) / 8;
uint16_t elem = (pos.x + pos.y*screen_width) % 8;
buf[cell] = buf[cell] & (bw << elem);
buf[cell] &= ~(1 << elem);
buf[cell] |= (bw << elem);
}
void gfx_setPixel(point_t pos, color_t color)