From d47cf26d31d9ca5c8308b02d498f3296af606d32 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 17 Dec 2012 00:16:15 +0100 Subject: SSD1289 reset_viewport quick fix --- drivers/gdisp/SSD1289/gdisp_lld.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'drivers/gdisp/SSD1289/gdisp_lld.c') diff --git a/drivers/gdisp/SSD1289/gdisp_lld.c b/drivers/gdisp/SSD1289/gdisp_lld.c index 49600349..0f000637 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld.c +++ b/drivers/gdisp/SSD1289/gdisp_lld.c @@ -95,7 +95,7 @@ static __inline void set_cursor(coord_t x, coord_t y) { } } -static __inline void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy) { +void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy) { set_cursor(x, y); @@ -134,6 +134,19 @@ static __inline void set_viewport(coord_t x, coord_t y, coord_t cx, coord_t cy) set_cursor(x, y); } +void reset_viewport(void) { + switch(GDISP.Orientation) { + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + set_viewport(0, 0, GDISP_SCREEN_WIDTH, GDISP_SCREEN_HEIGHT); + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + set_viewport(0, 0, GDISP_SCREEN_HEIGHT, GDISP_SCREEN_WIDTH); + break; + } +} + /*===========================================================================*/ /* Driver interrupt handlers. */ /*===========================================================================*/ -- cgit v1.2.3