diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-04-16 07:39:00 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-04-16 09:11:49 -0600 |
commit | 90d1bf8b943e741b411d4427a73591a9e67308d5 (patch) | |
tree | b11ee5bf763186b68eb4601adb50957b5965443e /apps/examples/nxlines/nxlines_main.c | |
parent | 57285f5dee6d4b9c93b63f70365c81ea195400d0 (diff) | |
download | px4-nuttx-90d1bf8b943e741b411d4427a73591a9e67308d5.tar.gz px4-nuttx-90d1bf8b943e741b411d4427a73591a9e67308d5.tar.bz2 px4-nuttx-90d1bf8b943e741b411d4427a73591a9e67308d5.zip |
Correct use of the BOARDIOC_GRAPHICS_SETUP boardctl() call
Diffstat (limited to 'apps/examples/nxlines/nxlines_main.c')
-rw-r--r-- | apps/examples/nxlines/nxlines_main.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/examples/nxlines/nxlines_main.c b/apps/examples/nxlines/nxlines_main.c index 08d2573e8..eb4a26b13 100644 --- a/apps/examples/nxlines/nxlines_main.c +++ b/apps/examples/nxlines/nxlines_main.c @@ -122,18 +122,27 @@ static inline int nxlines_initialize(void) FAR NX_DRIVERTYPE *dev; #if defined(CONFIG_EXAMPLES_NXLINES_EXTERNINIT) + struct boardioc_graphics_s devinfo; + int ret; + /* Use external graphics driver initialization */ printf("nxlines_initialize: Initializing external graphics device\n"); - dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXLINES_DEVNO); - if (!dev) + + devinfo.devno = CONFIG_EXAMPLES_NXLINES_DEVNO; + devinfo.dev = NULL; + + ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); + if (ret < 0) { - printf("nxlines_initialize: boardctl failed, devno=%d\n", - CONFIG_EXAMPLES_NXLINES_DEVNO); + printf("nxlines_initialize: boardctl failed, devno=%d: %d\n", + CONFIG_EXAMPLES_NXLINES_DEVNO, errno); g_nxlines.code = NXEXIT_EXTINITIALIZE; return ERROR; } + dev = devinfo.dev; + #elif defined(CONFIG_NX_LCDDRIVER) int ret; |