aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-07-08 11:47:36 +1000
committerinmarket <andrewh@inmarket.com.au>2018-07-08 11:47:36 +1000
commitbda8c738b10c136ad1557acc1a07174ceb3e4f73 (patch)
treecd686b249bfa8bde518668cfe5a7f9f3914ad13f /src
parentf9c848e9851713d7a33962b9b4768c0a0d1751f1 (diff)
downloaduGFX-bda8c738b10c136ad1557acc1a07174ceb3e4f73.tar.gz
uGFX-bda8c738b10c136ad1557acc1a07174ceb3e4f73.tar.bz2
uGFX-bda8c738b10c136ad1557acc1a07174ceb3e4f73.zip
Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX
Diffstat (limited to 'src')
-rw-r--r--src/gdisp/gdisp.c2
-rw-r--r--src/gdisp/gdisp.h39
-rw-r--r--src/gdisp/gdisp_driver.h2
-rw-r--r--src/gdisp/gdisp_pixmap.c2
4 files changed, 25 insertions, 20 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 5b58bb90..f3bac3bd 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -711,7 +711,7 @@ unsigned gdispGetDisplayCount(void) {
gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; }
gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; }
-powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
+gPowermode gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; }
uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; }
uint8_t gdispGGetContrast(GDisplay *g) { return g->g.Contrast; }
diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h
index a808c7df..4fe0d823 100644
--- a/src/gdisp/gdisp.h
+++ b/src/gdisp/gdisp.h
@@ -108,15 +108,15 @@ typedef enum orientation {
} orientation_t;
/**
- * @enum powermode
+ * @enum gPowermode
* @brief Type for the available power modes for the screen.
*/
-typedef enum powermode {
- powerOff, /**< Turn the display off. */
- powerSleep, /**< Put the display into sleep mode. */
- powerDeepSleep, /**< Put the display into deep-sleep mode. */
- powerOn /**< Turn the display on. */
-} powermode_t;
+typedef enum gPowermode {
+ gPowerOff, /**< Turn the display off. */
+ gPowerSleep, /**< Put the display into sleep mode. */
+ gPowerDeepSleep, /**< Put the display into deep-sleep mode. */
+ gPowerOn /**< Turn the display on. */
+} gPowermode;
/*
* Our black box display structure.
@@ -139,7 +139,7 @@ extern GDisplay *GDISP;
* @details Unsupported control codes are ignored.
* @note The value parameter should always be typecast to (void *).
* @note There are some predefined and some specific to the low level driver.
- * @note GDISP_CONTROL_POWER - Takes a gdisp_powermode_t
+ * @note GDISP_CONTROL_POWER - Takes a gPowermode
* GDISP_CONTROL_ORIENTATION - Takes a gdisp_orientation_t
* GDISP_CONTROL_BACKLIGHT - Takes an int from 0 to 100. For a driver
* that only supports off/on anything other
@@ -322,7 +322,7 @@ gCoord gdispGGetHeight(GDisplay *g);
*
* @api
*/
-powermode_t gdispGGetPowerMode(GDisplay *g);
+gPowermode gdispGGetPowerMode(GDisplay *g);
#define gdispGetPowerMode() gdispGGetPowerMode(GDISP)
/**
@@ -740,7 +740,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
*/
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, gColor color);
#define gdispDrawThickArc(x,y,rs,re,s,e,c) gdispGDrawThickArc(GDISP,x,y,rs,re,s,e,c)
-
+
/**
* @brief Draw a filled arc.
* @pre GDISP_NEED_ARC must be GFXON in your gfxconf.h
@@ -1102,7 +1102,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
* @api
*/
const char *gdispGetFontName(font_t font);
-
+
/**
* @brief Add a font permanently to the font list.
* @returns gTrue on success. Reasons it may fail: out of memory, if it is already on the list, it is not a font loaded in RAM.
@@ -1167,8 +1167,8 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
*
* @api
*/
-#define gdispGSetPowerMode(g, powerMode) gdispGControl((g), GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
-#define gdispSetPowerMode(powerMode) gdispGControl(GDISP, GDISP_CONTROL_POWER, (void *)(unsigned)(powerMode))
+#define gdispGSetPowerMode(g, powerMode) gdispGControl((g), GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))
+#define gdispSetPowerMode(powerMode) gdispGControl(GDISP, GDISP_CONTROL_POWER, (void *)(gPowermode)(powerMode))
/**
* @brief Set the display orientation.
@@ -1230,10 +1230,15 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
/* V2 compatibility */
#if GFX_COMPAT_V2
- typedef gColor color_t;
- typedef gPixel pixel_t;
- typedef gCoord coord_t;
- typedef gPoint point, point_t;
+ typedef gPowermode powermode_t;
+ #define gPowerOff powerOff
+ #define gPowerDeepSleep powerDeepSleep
+ #define gPowerSleep powerSleep
+ #define gPowerOn powerOn
+ typedef gColor color_t;
+ typedef gPixel pixel_t;
+ typedef gCoord coord_t;
+ typedef gPoint point, point_t;
#endif
#endif /* GFX_USE_GDISP */
diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h
index 11af847d..8b5bc7b9 100644
--- a/src/gdisp/gdisp_driver.h
+++ b/src/gdisp/gdisp_driver.h
@@ -321,7 +321,7 @@ struct GDisplay {
gCoord Width;
gCoord Height;
orientation_t Orientation;
- powermode_t Powermode;
+ gPowermode Powermode;
uint8_t Backlight;
uint8_t Contrast;
} g;
diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c
index 8fbccad4..e65e6e71 100644
--- a/src/gdisp/gdisp_pixmap.c
+++ b/src/gdisp/gdisp_pixmap.c
@@ -123,7 +123,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOn;
+ g->g.Powermode = gPowerOn;
g->board = 0;
return gTrue;