aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/S6D1121/gdisp_lld.c
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2012-09-10 20:38:54 +1000
committerAndrew Hannam <andrewh@inmarket.com.au>2012-09-10 20:38:54 +1000
commit7025d927cace6ac9f1c47c2461498e5682f75bda (patch)
tree30cf07ed9ce2370b0a82323590f3569f38dc12bd /drivers/gdisp/S6D1121/gdisp_lld.c
parent3a8d39980b9124fe899605cb5350f42d093b1a10 (diff)
downloaduGFX-7025d927cace6ac9f1c47c2461498e5682f75bda.tar.gz
uGFX-7025d927cace6ac9f1c47c2461498e5682f75bda.tar.bz2
uGFX-7025d927cace6ac9f1c47c2461498e5682f75bda.zip
Clip Boundary Conditions & Nokia6610 Fixes
Clipping Boundary Conditions are now fixed. Nokia6610 Driver now works properly, also supports setting LCD contrast.
Diffstat (limited to 'drivers/gdisp/S6D1121/gdisp_lld.c')
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gdisp/S6D1121/gdisp_lld.c b/drivers/gdisp/S6D1121/gdisp_lld.c
index f6e8166a..c48171d9 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld.c
+++ b/drivers/gdisp/S6D1121/gdisp_lld.c
@@ -187,8 +187,8 @@ bool_t GDISP_LLD(init)(void) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
GDISP.clipx0 = 0;
GDISP.clipy0 = 0;
- GDISP.clipx1 = GDISP.Width-1;
- GDISP.clipy1 = GDISP.Height-1;
+ GDISP.clipx1 = GDISP.Width;
+ GDISP.clipy1 = GDISP.Height;
#endif
return TRUE;
}
@@ -252,8 +252,8 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
if (cx <= 0 || cy <= 0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
- if (x+cx > GDISP.clipx1) cx -= GDISP.clipx1 - x;
- if (y+cy > GDISP.clipy1) cy -= GDISP.clipy1 - y;
+ if (x+cx > GDISP.clipx1) cx = GDISP.clipx1 - x;
+ if (y+cy > GDISP.clipy1) cy = GDISP.clipy1 - y;
#endif
area = cx*cy;
@@ -288,8 +288,8 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; srcy += GDISP.clipy0 - y; y = GDISP.clipy0; }
if (srcx+cx > srccx) cx = srccx - srcx;
if (cx <= 0 || cy <= 0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
- if (x+cx > GDISP.clipx1) cx -= GDISP.clipx1 - x;
- if (y+cy > GDISP.clipy1) cy -= GDISP.clipy1 - y;
+ if (x+cx > GDISP.clipx1) cx = GDISP.clipx1 - x;
+ if (y+cy > GDISP.clipy1) cy = GDISP.clipy1 - y;
#endif
lld_lcdSetViewPort(x, y, cx, cy);
@@ -366,7 +366,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
if (!lines || cx <= 0 || cy <= 0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
- if (x+cx > GDISP.clipx1) cx -= GDISP.clipx1 - x;
+ if (x+cx > GDISP.clipx1) cx = GDISP.clipx1 - x;
if (y+cy > GDISP.clipy1) cy = GDISP.clipy1 - y;
#endif