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/nx/nx_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/nx/nx_main.c')
-rw-r--r-- | apps/examples/nx/nx_main.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/examples/nx/nx_main.c b/apps/examples/nx/nx_main.c index e9d3eaa92..dbdd608fa 100644 --- a/apps/examples/nx/nx_main.c +++ b/apps/examples/nx/nx_main.c @@ -427,17 +427,27 @@ static inline int nxeg_suinitialize(void) FAR NX_DRIVERTYPE *dev; #if defined(CONFIG_EXAMPLES_NX_EXTERNINIT) + struct boardioc_graphics_s devinfo; + int ret; + /* Use external graphics driver initialization */ printf("nxeg_initialize: Initializing external graphics device\n"); - dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NX_DEVNO); - if (!dev) + + devinfo.devno = CONFIG_EXAMPLES_NX_DEVNO; + devinfo.dev = NULL; + + ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); + if (ret < 0) { - printf("nxeg_initialize: boardctl failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO); + printf("nxeg_initialize: boardctl failed, devno=%d: %d\n", + CONFIG_EXAMPLES_NX_DEVNO, errno); g_exitcode = NXEXIT_EXTINITIALIZE; return ERROR; } + dev = devinfo.dev; + #elif defined(CONFIG_NX_LCDDRIVER) int ret; |