From: Nils Faerber Date: Sat, 6 Jul 2013 21:16:05 +0000 (+0200) Subject: Add clipping for LCD draw_pixel X-Git-Url: https://git.karo-electronics.de/?p=oswald.git;a=commitdiff_plain;h=670e9311524e181307ccb2be481215648a3b31cf;ds=sidebyside Add clipping for LCD draw_pixel --- diff --git a/metawatch/oswald_hal.c b/metawatch/oswald_hal.c index 16b1cd1..8c802c4 100644 --- a/metawatch/oswald_hal.c +++ b/metawatch/oswald_hal.c @@ -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); }