From 49dab79a30730c8b0a64594005a79b8ddb9ae67c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 22 Nov 2017 07:22:03 -0600 Subject: [PATCH] apps/pdcur34: Define pdc_color_t based on pixel depth, not on specific color format. --- examples/pdcurses/firework_main.c | 1 - examples/pdcurses/newdemo_main.c | 1 - examples/pdcurses/xmas_main.c | 2 -- graphics/pdcurs34/nuttx/pdcdisp.c | 2 +- graphics/pdcurs34/nuttx/pdcnuttx.h | 7 +++---- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/pdcurses/firework_main.c b/examples/pdcurses/firework_main.c index e5d162eaf..b81e8c3a9 100644 --- a/examples/pdcurses/firework_main.c +++ b/examples/pdcurses/firework_main.c @@ -43,7 +43,6 @@ #include #include -#include #include #include #include diff --git a/examples/pdcurses/newdemo_main.c b/examples/pdcurses/newdemo_main.c index e66ca0b6b..03a19dfaf 100644 --- a/examples/pdcurses/newdemo_main.c +++ b/examples/pdcurses/newdemo_main.c @@ -45,7 +45,6 @@ ****************************************************************************/ #include -#include #include #include #include diff --git a/examples/pdcurses/xmas_main.c b/examples/pdcurses/xmas_main.c index 3009e2834..34a258818 100644 --- a/examples/pdcurses/xmas_main.c +++ b/examples/pdcurses/xmas_main.c @@ -55,8 +55,6 @@ * Included Files ****************************************************************************/ -#include - #include "graphics/curses.h" /**************************************************************************** diff --git a/graphics/pdcurs34/nuttx/pdcdisp.c b/graphics/pdcurs34/nuttx/pdcdisp.c index 5a70cb7a4..0a6ec3932 100644 --- a/graphics/pdcurs34/nuttx/pdcdisp.c +++ b/graphics/pdcurs34/nuttx/pdcdisp.c @@ -217,7 +217,7 @@ static inline void PDC_render_gyph(FAR struct pdc_fbstate_s *fbstate, /* Then render the glyph into the allocated memory * * REVISIT: The case where visibility==1 is not yet handled. In that - * case, only the lowe quarter of the glyph should be reversed. + * case, only the lower quarter of the glyph should be reversed. */ ret = RENDERER((FAR pdc_color_t *)fbstart, diff --git a/graphics/pdcurs34/nuttx/pdcnuttx.h b/graphics/pdcurs34/nuttx/pdcnuttx.h index a64119fe9..cfc91b701 100644 --- a/graphics/pdcurs34/nuttx/pdcnuttx.h +++ b/graphics/pdcurs34/nuttx/pdcnuttx.h @@ -108,7 +108,6 @@ #endif #if defined(CONFIG_PDCURSES_COLORFMT_Y1) -# warning CONFIG_PDCURSES_COLORFMT_Y1 not yet supported # define PDCURSES_COLORFMT FB_FMT_Y1 # define PDCURSES_BPP 1 # define PDCURSES_INIT_COLOR PDCURSES_BGCOLOR_GREYLEVEL @@ -198,11 +197,11 @@ struct pdc_rgbcolor_s /* Holds one framebuffer pixel */ -#if defined(CONFIG_PDCURSES_COLORFMT_RGB332) +#if PDCURSES_BPP <= 8 typedef uint8_t pdc_color_t; -#elif defined(CONFIG_PDCURSES_COLORFMT_RGB565) +#elif PDCURSES_BPP <= 16 typedef uint16_t pdc_color_t; -#elif defined(CONFIG_PDCURSES_COLORFMT_RGB888) +#elif PDCURSES_BPP <= 32 typedef uint32_t pdc_color_t; #endif