diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-11-17 23:32:19 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-11-17 23:32:19 +1000 |
commit | 7f1b78a067e11c2394d83dbbc9b0fc78f78af493 (patch) | |
tree | cd49bed0ef2fb5469282f525c77e707620e7fbfb /drivers/gdisp | |
parent | 643670ecd1c4dc631b4073d2384ff7fa56cb564d (diff) | |
download | uGFX-7f1b78a067e11c2394d83dbbc9b0fc78f78af493.tar.gz uGFX-7f1b78a067e11c2394d83dbbc9b0fc78f78af493.tar.bz2 uGFX-7f1b78a067e11c2394d83dbbc9b0fc78f78af493.zip |
Replace color format conversion macros with proper routines to prevent side effects with using the macro.
Also fix a number of compiler warnings.
Diffstat (limited to 'drivers/gdisp')
-rw-r--r-- | drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c | 3 | ||||
-rw-r--r-- | drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c | 2 | ||||
-rw-r--r-- | drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c | 4 | ||||
-rw-r--r-- | drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c | 4 | ||||
-rw-r--r-- | drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c | 2 | ||||
-rw-r--r-- | drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 44 | ||||
-rw-r--r-- | drivers/gdisp/RA8875/gdisp_lld_RA8875.c | 2 | ||||
-rw-r--r-- | drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c | 8 | ||||
-rw-r--r-- | drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 4 | ||||
-rw-r--r-- | drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c | 2 | ||||
-rw-r--r-- | drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c | 8 | ||||
-rw-r--r-- | drivers/gdisp/ST7565/gdisp_lld_ST7565.c | 4 |
15 files changed, 61 insertions, 44 deletions
diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c index 3ab1de79..166f564b 100644 --- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c +++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c @@ -493,6 +493,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint8_t bitpos; switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: bx = g->p.x / EINK_BLOCKWIDTH; dx = g->p.x % EINK_BLOCKWIDTH; @@ -524,7 +525,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { bitpos = (6 - 2 * (dx % EINK_PPB)); byte = block->data[dy][dx / EINK_PPB]; byte &= ~(PIXELMASK << bitpos); - if (COLOR2NATIVE(g->p.color) != Black) + if (gdispColor2Native(g->p.color) != Black) byte |= PIXEL_WHITE << bitpos; else byte |= PIXEL_BLACK << bitpos; diff --git a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c index 4514b495..88d3d19a 100644 --- a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c +++ b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c @@ -167,7 +167,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { busmode16(g); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_ram16(g, COLOR2NATIVE(g->p.color)); + write_ram16(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { busmode8(g); diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index e65e0a77..816d9956 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -60,6 +60,7 @@ static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: case GDISP_ROTATE_180: write_reg(g, 0x20, g->p.x); @@ -77,6 +78,7 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay *g) { switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: case GDISP_ROTATE_180: write_reg(g, 0x50, g->p.x); @@ -204,7 +206,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); @@ -228,7 +230,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint16_t data; data = read_data(g); - return NATIVE2COLOR(data); + return gdispNative2Color(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { setwritemode(g); diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c index ffd67cf7..0197a536 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c +++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c @@ -61,6 +61,7 @@ static void set_cursor(GDisplay *g) { switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: case GDISP_ROTATE_180: write_reg(g, 0x20, g->p.x); @@ -78,6 +79,7 @@ static void set_cursor(GDisplay *g) { static void set_viewport(GDisplay* g) { switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: case GDISP_ROTATE_180: write_reg(g, 0x50, g->p.x); @@ -200,7 +202,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { set_viewport(g); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); @@ -222,7 +224,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint16_t data; data = read_data(g); - return NATIVE2COLOR(data); + return gdispNative2Color(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { setwritemode(g); diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c index 2513c48d..f4781059 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c +++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c @@ -246,7 +246,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { write_index(g, 0x2C); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data16(g, COLOR2NATIVE(g->p.color)); + write_data16(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); @@ -265,7 +265,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint16_t data; data = read_data(g); - return NATIVE2COLOR(data); + return gdispNative2Color(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { setwritemode(g); diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c index 2b2f0917..c96faf33 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c +++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c @@ -211,7 +211,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { set_viewport(g); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); @@ -229,7 +229,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint16_t data; data = read_data(g); - return NATIVE2COLOR(data); + return gdispNative2Color(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { setwritemode(g); diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c index 28a2fceb..261f6f66 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c @@ -145,7 +145,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_write_color(GDisplay *g) { uint16_t c; - c = COLOR2NATIVE(g->p.color); + c = gdispColor2Native(g->p.color); if ((g->flags & GDISP_FLG_ODDBYTE)) { // Write the pair of pixels to the display write_data3(g, ((savecolor(g) >> 4) & 0xFF), diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index f6ce4278..afb060c1 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -139,22 +139,23 @@ static inline void set_viewport(GDisplay* g) { #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL switch(g->g.Orientation) { - case GDISP_ROTATE_0: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set - break; - case GDISP_ROTATE_90: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); - break; - case GDISP_ROTATE_180: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); - break; - case GDISP_ROTATE_270: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); - break; + default: + case GDISP_ROTATE_0: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set + break; + case GDISP_ROTATE_90: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); + break; + case GDISP_ROTATE_180: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); + break; + case GDISP_ROTATE_270: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); + break; } #else write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x+g->p.cx-1); // Column address set @@ -233,7 +234,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_write_color(GDisplay *g) { uint16_t c; - c = COLOR2NATIVE(g->p.color); + c = gdispColor2Native(g->p.color); #if GDISP_GE8_BROKEN_CONTROLLER if (!(g->flags & GDISP_FLG_RUNBYTE)) { PRIV->firstcolor = c; @@ -289,7 +290,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { uint16_t c; - c = COLOR2NATIVE(g->p.color); + c = gdispColor2Native(g->p.color); acquire_bus(g); set_viewport(g); write_data3(g, 0, (c>>8) & 0x0F, c & 0xFF); @@ -307,7 +308,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { tuples = (g->p.cx*g->p.cy+1)>>1; // With an odd sized area we over-print by one pixel. // This extra pixel overwrites the first pixel (harmless as it is the same colour) - c = COLOR2NATIVE(g->p.color); + c = gdispColor2Native(g->p.color); acquire_bus(g); set_viewport(g); while(tuples--) @@ -348,6 +349,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { * to column cx-1, cx-2 etc. We therefore have to write-out the last bitmap line first. */ switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: x = 0; y = 0; break; case GDISP_ROTATE_90: x = g->p.cx-1; y = 0; break; case GDISP_ROTATE_180: x = g->p.cx-1; y = g->p.cy-1; break; @@ -364,7 +366,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { while(tuples--) { /* Get a pixel */ - c1 = COLOR2NATIVE(*p++); + c1 = gdispColor2Native(*p++); /* Check for line or buffer wrapping */ if (++x >= g->p.cx) { @@ -377,7 +379,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { } /* Get the next pixel */ - c2 = COLOR2NATIVE(*p++); + c2 = gdispColor2Native(*p++); /* Check for line or buffer wrapping */ if (++x >= g->p.cx) { diff --git a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c index d28670c6..e3fee636 100644 --- a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c +++ b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c @@ -184,7 +184,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { set_viewport(g); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c index cca9d67e..78b659de 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c +++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c @@ -64,6 +64,7 @@ static inline void set_cursor(GDisplay *g) { * R21h - 9 bit */ switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: write_reg(g, 0x20, g->p.x & 0x00FF); write_reg(g, 0x21, g->p.y & 0x01FF); @@ -91,6 +92,7 @@ static inline void set_viewport(GDisplay *g) { */ switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: write_reg(g, 0x46, (((g->p.x + g->p.cx - 1) << 8) & 0xFF00 ) | (g->p.x & 0x00FF)); write_reg(g, 0x48, g->p.y & 0x01FF); @@ -221,7 +223,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { set_viewport(g); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); @@ -243,7 +245,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint16_t data; data = read_data(g); - return NATIVE2COLOR(data); + return gdispNative2Color(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { setwritemode(g); diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index d96f9479..79ac7dd9 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -52,6 +52,7 @@ static void set_cursor(GDisplay *g) { * Use a bit mask to make sure they are not set too high */ switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: write_reg(g, 0x4e, g->p.x & 0x00FF); write_reg(g, 0x4f, g->p.y & 0x01FF); @@ -83,6 +84,7 @@ static void set_viewport(GDisplay* g) { * Use a bit mask to make sure they are not set too high */ switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: write_reg(g, 0x44, (((g->p.x+g->p.cx-1) << 8) & 0xFF00 ) | (g->p.x & 0x00FF)); write_reg(g, 0x45, g->p.y & 0x01FF); @@ -200,7 +202,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); @@ -224,7 +226,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint16_t data; data = read_data(g); - return NATIVE2COLOR(data); + return gdispNative2Color(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { setwritemode(g); @@ -236,7 +238,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { uint16_t c; - c = COLOR2NATIVE(g->p.color); + c = gdispColor2Native(g->p.color); acquire_bus(g); set_viewport(g); set_cursor(g); diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index b72ba781..b7bce1e2 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -159,6 +159,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { coord_t x, y; switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: x = g->p.x; y = g->p.y; @@ -176,7 +177,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { x = g->p.x; break; } - if (COLOR2NATIVE(g->p.color) != Black) + if (gdispColor2Native(g->p.color) != Black) RAM(g)[xyaddr(x, y)] |= xybit(y); else RAM(g)[xyaddr(x, y)] &= ~xybit(y); @@ -189,6 +190,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { coord_t x, y; switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: x = g->p.x; y = g->p.y; diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c index eb1b9b15..e1924c2d 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c +++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c @@ -188,7 +188,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { set_viewport(g); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c index 9594ff95..a58d2973 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c +++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c @@ -53,6 +53,7 @@ static void set_cursor(GDisplay* g) { * Use a bit mask to make sure they are not set too high */ switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: write_reg(g, SSD2119_REG_X_RAM_ADDR, g->p.x & 0x01FF); write_reg(g, SSD2119_REG_Y_RAM_ADDR, g->p.y & 0x00FF); @@ -83,6 +84,7 @@ static void set_viewport(GDisplay* g) { * 0 <= HSA <= HEA <= 0x13F */ switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: write_reg(g, SSD2119_REG_V_RAM_POS, (((g->p.y + g->p.cy - 1) << 8) & 0xFF00 ) | (g->p.y & 0x00FF)); write_reg(g, SSD2119_REG_H_RAM_START, (g->p.x & 0x01FF)); @@ -238,7 +240,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g) { set_viewport(g); } LLDSPEC void gdisp_lld_write_color(GDisplay* g) { - write_data(g, COLOR2NATIVE(g->p.color)); + write_data(g, gdispColor2Native(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay* g) { release_bus(g); @@ -260,7 +262,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g) { uint16_t data; data = read_data(g); - return NATIVE2COLOR(data); + return gdispNative2Color(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay* g) { setwritemode(g); @@ -272,7 +274,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g) { LLDSPEC void gdisp_lld_fill_area(GDisplay* g) { uint16_t c; - c = COLOR2NATIVE(g->p.color); + c = gdispColor2Native(g->p.color); acquire_bus(g); set_viewport(g); set_cursor(g); diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c index 2bb5406f..769f2eaf 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c +++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c @@ -150,6 +150,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { coord_t x, y; switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: x = g->p.x; y = g->p.y; @@ -167,7 +168,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { y = g->p.x; break; } - if (COLOR2NATIVE(g->p.color) != Black) + if (gdispColor2Native(g->p.color) != Black) RAM(g)[xyaddr(x, y)] |= xybit(y); else RAM(g)[xyaddr(x, y)] &= ~xybit(y); @@ -180,6 +181,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { coord_t x, y; switch(g->g.Orientation) { + default: case GDISP_ROTATE_0: x = g->p.x; y = g->p.y; |