From e61f0ae4248bdafeace54c330d488904a495c045 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 8 Jul 2018 13:51:20 +1000 Subject: Added type gOrientation to replace V2.x orientation_t, and values gOrientationX replace GDISP_ROTATE_X --- drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c') diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index 5d3a1380..dbd2d8e4 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -287,7 +287,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { // Initialise the GDISP structure g->g.Width = ((ltdcLayerConfig *)g->priv)->width; g->g.Height = ((ltdcLayerConfig *)g->priv)->height; - g->g.Orientation = GDISP_ROTATE_0; + g->g.Orientation = gOrientation0; g->g.Powermode = gPowerOn; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; @@ -300,17 +300,17 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -338,17 +338,17 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-1); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-1, g->g.Height-g->p.y-1); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-1, g->p.x); break; } @@ -376,12 +376,12 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { LLDSPEC void gdisp_lld_control(GDisplay* g) { switch(g->p.x) { case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) + if (g->g.Orientation == (gOrientation)g->p.ptr) return; - switch((orientation_t)g->p.ptr) { - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) { + switch((gOrientation)g->p.ptr) { + case gOrientation0: + case gOrientation180: + if (g->g.Orientation == gOrientation90 || g->g.Orientation == gOrientation270) { gCoord tmp; tmp = g->g.Width; @@ -389,9 +389,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { g->g.Height = tmp; } break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) { + case gOrientation90: + case gOrientation270: + if (g->g.Orientation == gOrientation0 || g->g.Orientation == gOrientation180) { gCoord tmp; tmp = g->g.Width; @@ -402,7 +402,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { default: return; } - g->g.Orientation = (orientation_t)g->p.ptr; + g->g.Orientation = (gOrientation)g->p.ptr; return; case GDISP_CONTROL_BACKLIGHT: @@ -452,23 +452,23 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { #if GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: + case gOrientation0: default: pos = PIXIL_POS(g, g->p.x, g->p.y); lineadd = g->g.Width - g->p.cx; shape = (g->p.cx << 16) | (g->p.cy); break; - case GDISP_ROTATE_90: + case gOrientation90: pos = PIXIL_POS(g, g->p.y, g->g.Width-g->p.x-g->p.cx); lineadd = g->g.Height - g->p.cy; shape = (g->p.cy << 16) | (g->p.cx); break; - case GDISP_ROTATE_180: + case gOrientation180: pos = PIXIL_POS(g, g->g.Width-g->p.x-g->p.cx, g->g.Height-g->p.y-g->p.cy); lineadd = g->g.Width - g->p.cx; shape = (g->p.cx << 16) | (g->p.cy); break; - case GDISP_ROTATE_270: + case gOrientation270: pos = PIXIL_POS(g, g->g.Height-g->p.y-g->p.cy, g->p.x); lineadd = g->g.Height - g->p.cy; shape = (g->p.cy << 16) | (g->p.cx); @@ -520,7 +520,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { DMA2D->CR = DMA2D_CR_MODE_R2M | DMA2D_CR_START; } - /* Oops - the DMA2D only supports GDISP_ROTATE_0. + /* Oops - the DMA2D only supports gOrientation0. * * Where the width is 1 we can trick it for other orientations. * That is worthwhile as a width of 1 is common. For other @@ -531,7 +531,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { * other formats we also need to fall back to pixel pushing. * * As the code to actually do all that for other than the - * simplest case (orientation == GDISP_ROTATE_0 and + * simplest case (orientation == gOrientation0 and * GDISP_PIXELFORMAT == GDISP_LLD_PIXELFORMAT) is very complex * we will always pixel push for now. In practice that is OK as * access to the framebuffer is fast - probably faster than DMA2D. -- cgit v1.2.3