mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-18 00:11:20 +08:00
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:
@@ -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 */
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user