Add clipping for LCD draw_pixel
authorNils Faerber <nils.faerber@kernelconcepts.de>
Sat, 6 Jul 2013 21:16:05 +0000 (23:16 +0200)
committerNils Faerber <nils.faerber@kernelconcepts.de>
Sat, 6 Jul 2013 21:16:05 +0000 (23:16 +0200)
metawatch/oswald_hal.c

index 16b1cd1..8c802c4 100644 (file)
@@ -39,8 +39,10 @@ const char *hal_get_radio_version_string(void)
 
 void hal_lcd_set_pixel(uint8_t x, uint8_t y, uint8_t color)
 {
-       x %= 96;
-       y %= 96;
+       if (x > 95)
+               x = 95;
+       if (y > 95)
+               y = 95;
        mw_lcd_draw_pixel(x, y, color ? LCD_BLACK : LCD_WHITE);
 }