From fe61558e8883d45fbe13e121c6885ea77d42f6e8 Mon Sep 17 00:00:00 2001 From: Tectu Date: Wed, 25 Jul 2012 00:22:50 +0200 Subject: [PATCH 1/2] fixed lcdRectDraw() --- glcd/glcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glcd/glcd.c b/glcd/glcd.c index 6f61cb5c..6c3a830b 100644 --- a/glcd/glcd.c +++ b/glcd/glcd.c @@ -462,12 +462,12 @@ void lcdDrawRect(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t fil y0 = TempY; } if(filled) { - lcdFillArea(x0, y0, x1, y1, color); + lcdFillArea(x0, y0, x1+1, y1+1, color); } else { lcdDrawLine(x0, y0, x1, y0, color); lcdDrawLine(x0, y1, x1, y1, color); lcdDrawLine(x0, y0, x0, y1, color); - lcdDrawLine(x1, y0, x1, y1, color); + lcdDrawLine(x1, y0, x1, y1+1, color); } } @@ -477,7 +477,7 @@ void lcdDrawRectString(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, const off_left = ((x1-x0)-lcdMeasureString(str, font))/2; off_up = ((y1-y0) - lcdGetFontHeight(font)) / 2; - lcdDrawRect(x0, y0, x1, y1, 1, bkColor); + lcdDrawRect(x0, y0, x1, y1, filled, bkColor); /* Abhishek: default to solid text for this? */ lcdDrawString(x0+off_left, y0+off_up, str, font, fontColor, bkColor, solid); } From 999486233dd5ec388a8c1c676c19effc6047b090 Mon Sep 17 00:00:00 2001 From: Tectu Date: Wed, 25 Jul 2012 04:00:30 +0200 Subject: [PATCH 2/2] lcdVerticalScroll() fix --- drivers/lcd/ssd1289_lld.c | 2 +- drivers/lcd/ssd1289_lld.h | 2 +- glcd/glcd.c | 2 +- glcd/glcd.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/lcd/ssd1289_lld.c b/drivers/lcd/ssd1289_lld.c index 09769a4b..04d69a2a 100644 --- a/drivers/lcd/ssd1289_lld.c +++ b/drivers/lcd/ssd1289_lld.c @@ -417,7 +417,7 @@ uint16_t lld_lcdGetWidth(void) { } /* a positive lines value shifts the screen up, negative down */ -void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t lines) { +void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) { uint16_t row0, row1; uint16_t i; diff --git a/drivers/lcd/ssd1289_lld.h b/drivers/lcd/ssd1289_lld.h index bea4bedf..16a9ef0d 100644 --- a/drivers/lcd/ssd1289_lld.h +++ b/drivers/lcd/ssd1289_lld.h @@ -24,7 +24,7 @@ uint16_t lld_lcdGetPixelColor(uint16_t x, uint16_t y); uint16_t lld_lcdGetOrientation(void); uint16_t lld_lcdGetHeight(void); uint16_t lld_lcdGetWidth(void); -void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t lines); +void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines); #ifdef __cplusplus } diff --git a/glcd/glcd.c b/glcd/glcd.c index 6c3a830b..58220559 100644 --- a/glcd/glcd.c +++ b/glcd/glcd.c @@ -253,7 +253,7 @@ glcd_result_t lcdWriteStream(uint16_t *buffer, uint16_t size) { return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); } -glcd_result_t lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t lines) { +glcd_result_t lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) { struct glcd_msg_vertical_scroll msg; msg.action = GLCD_VERTICAL_SCROLL; diff --git a/glcd/glcd.h b/glcd/glcd.h index 4ae26233..4048fbe8 100644 --- a/glcd/glcd.h +++ b/glcd/glcd.h @@ -89,7 +89,7 @@ uint16_t lcdBGR2RGB(uint16_t color); uint16_t lcdGetPixelColor(uint16_t x, uint16_t y); /* Scrolling function */ -glcd_result_t lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t lines); +glcd_result_t lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines); #ifdef __cplusplus }