From 96e1a80f99c42fb81731645b24bdfb0408f0cf00 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Fri, 26 May 2017 11:36:36 -0300 Subject: [PATCH] Replace the structure initializer with C89 style --- drivers/lcd/pcd8544.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/drivers/lcd/pcd8544.c b/drivers/lcd/pcd8544.c index 1e8f0e2f3b1..c5d3c86fa1c 100644 --- a/drivers/lcd/pcd8544.c +++ b/drivers/lcd/pcd8544.c @@ -291,42 +291,51 @@ static uint8_t g_runbuffer[PCD8544_XSTRIDE+1]; static const struct fb_videoinfo_s g_videoinfo = { - .fmt = PCD8544_COLORFMT, /* Color format: RGB16-565: RRRR RGGG GGGB BBBB */ - .xres = PCD8544_XRES, /* Horizontal resolution in pixel columns */ - .yres = PCD8544_YRES, /* Vertical resolution in pixel rows */ - .nplanes = 1, /* Number of color planes supported */ + PCD8544_COLORFMT, /* Color format: RGB16-565: RRRR RGGG GGGB BBBB */ + PCD8544_XRES, /* Horizontal resolution in pixel columns */ + PCD8544_YRES, /* Vertical resolution in pixel rows */ + 1, /* Number of color planes supported */ }; /* This is the standard, NuttX Plane information object */ static const struct lcd_planeinfo_s g_planeinfo = { - .putrun = pcd8544_putrun, /* Put a run into LCD memory */ - .getrun = pcd8544_getrun, /* Get a run from LCD memory */ - .buffer = (FAR uint8_t *)g_runbuffer, /* Run scratch buffer */ - .bpp = PCD8544_BPP, /* Bits-per-pixel */ + pcd8544_putrun, /* Put a run into LCD memory */ + pcd8544_getrun, /* Get a run from LCD memory */ + (FAR uint8_t *)g_runbuffer, /* Run scratch buffer */ + PCD8544_BPP, /* Bits-per-pixel */ }; /* This is the standard, NuttX LCD driver object */ static struct pcd8544_dev_s g_pcd8544dev = { - .dev = + /* struct lcd_dev_s */ { /* LCD Configuration */ - .getvideoinfo = pcd8544_getvideoinfo, - .getplaneinfo = pcd8544_getplaneinfo, + pcd8544_getvideoinfo, + pcd8544_getplaneinfo, /* LCD RGB Mapping -- Not supported */ +#ifdef CONFIG_FB_CMAP + NULL, + NULL, +#endif + /* Cursor Controls -- Not supported */ +#ifdef CONFIG_FB_HWCURSOR + NULL, + NULL, +#endif /* LCD Specific Controls */ - .getpower = pcd8544_getpower, - .setpower = pcd8544_setpower, - .getcontrast = pcd8544_getcontrast, - .setcontrast = pcd8544_setcontrast, + pcd8544_getpower, + pcd8544_setpower, + pcd8544_getcontrast, + pcd8544_setcontrast, }, };