From 2fddb0f8edde0c5029f3d4e32be0a41a791469a9 Mon Sep 17 00:00:00 2001 From: Tectu Date: Mon, 28 May 2012 23:24:58 +0200 Subject: [PATCH] lcdDrawLine() fix, didnt work with x or y >=128 --- glcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glcd.c b/glcd.c index add31a20..35022fe6 100755 --- a/glcd.c +++ b/glcd.c @@ -170,11 +170,11 @@ void lcdDrawPixel(uint16_t x,uint16_t y,uint16_t point) { void lcdDrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color) { int16_t dy, dx; - int8_t addx=1, addy=1; + int16_t addx=1, addy=1; int16_t P, diff; int16_t i=0; - dx = abs((int8_t)(x2 - x1)); + dx = abs((int16_t)(x2 - x1)); dy = abs((int16_t)(y2 - y1)); if(x1 > x2)