aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@embedded.pro>2016-08-26 21:45:41 +0200
committerJoel Bodenmann <joel@embedded.pro>2016-08-26 21:45:41 +0200
commitea632d50012c2a65b54792167474bd8d4e6cf0bf (patch)
tree2a54678a477f0487b120e9cbc400a93378c7013a /drivers
parent8603afd3098b5fdb640cb214bda209137fe192ee (diff)
downloaduGFX-ea632d50012c2a65b54792167474bd8d4e6cf0bf.tar.gz
uGFX-ea632d50012c2a65b54792167474bd8d4e6cf0bf.tar.bz2
uGFX-ea632d50012c2a65b54792167474bd8d4e6cf0bf.zip
Minor improvement to the ST7565 driver
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gdisp/ST7565/gdisp_lld_ST7565.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
index 9ab46b57..fff1a37a 100644
--- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
+++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
@@ -82,6 +82,9 @@
LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
// The private area is the display surface.
g->priv = gfxAlloc(GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8);
+ if (!g->priv) {
+ return FALSE;
+ }
// Initialise the board interface
init_board(g);
@@ -127,13 +130,14 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
// Release the bus
release_bus(g);
- /* Initialise the GDISP structure */
+ // Initialise the GDISP structure
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST;
+
return TRUE;
}
@@ -247,7 +251,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
if (g->g.Orientation == (orientation_t)g->p.ptr)
return;
switch((orientation_t)g->p.ptr) {
- /* Rotation is handled by the drawing routines */
+ // Rotation is handled by the drawing routines
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
g->g.Height = GDISP_SCREEN_HEIGHT;