Rename up_nxdrvinit() to board_graphics_setup(). Add CONFIG_BOARDCTL_GRAPHICS that will enabled calls to board_graphics_setup() from boardctrl(). In apps/ and NxWidgts/, replace all calls to up_nxdrvinit with calls to boardctl().

This commit is contained in:
Gregory Nutt
2015-03-31 16:20:21 -06:00
parent 074b57aa69
commit 256abd6dba
19 changed files with 125 additions and 101 deletions

View File

@@ -1,7 +1,7 @@
/****************************************************************************
* examples/nximage/nximage.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -182,18 +182,14 @@ extern const struct nx_callback_s g_nximagecb;
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_EXAMPLES_NXIMAGE_EXTERNINIT
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
#endif
/* Background window interfaces */
extern void nximage_image(NXWINDOW hwnd);
void nximage_image(NXWINDOW hwnd);
/* Image interfaces */
extern nxgl_mxpixel_t nximage_bgcolor(void);
extern nxgl_mxpixel_t nximage_avgcolor(nxgl_mxpixel_t color1, nxgl_mxpixel_t color2);
extern void nximage_blitrow(FAR nxgl_mxpixel_t *run, FAR const void **state);
nxgl_mxpixel_t nximage_bgcolor(void);
nxgl_mxpixel_t nximage_avgcolor(nxgl_mxpixel_t color1, nxgl_mxpixel_t color2);
void nximage_blitrow(FAR nxgl_mxpixel_t *run, FAR const void **state);
#endif /* __APPS_EXAMPLES_NXIMAGE_NXIMAGE_H */

View File

@@ -1,7 +1,7 @@
/****************************************************************************
* examples/nximage/nximage_main.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/boardctl.h>
#include <stdint.h>
#include <stdbool.h>
@@ -130,10 +131,10 @@ static inline int nximage_initialize(void)
/* Use external graphics driver initialization */
printf("nximage_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXIMAGE_DEVNO);
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXIMAGE_DEVNO);
if (!dev)
{
printf("nximage_initialize: up_nxdrvinit failed, devno=%d\n",
printf("nximage_initialize: boardctl failed, devno=%d\n",
CONFIG_EXAMPLES_NXIMAGE_DEVNO);
g_nximage.code = NXEXIT_EXTINITIALIZE;
return ERROR;