apps/examples/touchscreen: Elimint BOARDIOC_TSCTEST_SETUP.
This commit is contained in:
parent
692180a9e9
commit
bfd8d1d6aa
@ -43,26 +43,4 @@ config EXAMPLES_TOUCHSCREEN_MOUSE
|
||||
The touchscreen test can also be configured to work with a mouse
|
||||
driver by setting this option.
|
||||
|
||||
config EXAMPLES_TOUCHSCREEN_ARCHINIT
|
||||
bool "Architecture-specific initialization"
|
||||
default y
|
||||
depends on LIB_BOARDCTL
|
||||
select BOARDCTL_TSCTEST
|
||||
---help---
|
||||
By default, the touchscreen example will call boardctl() to
|
||||
register the touchscreen device before it attempts to open it.
|
||||
Similarly, it will call boardctl() to unregister the touchscreen
|
||||
device when it is finished.
|
||||
|
||||
This works well for the typical touchscreen controller but there are
|
||||
other devices that cannot be initialized and uninitialized in this
|
||||
fashion. Consider a USB mouse, for example. The USB mouse will be
|
||||
registered when the mouse is connected and unregistered when the
|
||||
mouse is disconnected.
|
||||
|
||||
So, in cases like this, there are two options: (1) provide dummy
|
||||
board_tsc_setup() just to satisfy the linking requirements of
|
||||
boardctl() or, (2) de-select this option. If this option is de-
|
||||
selected, then the boardctl() will never be called.
|
||||
|
||||
endif
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/boardctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -106,9 +105,6 @@ int tc_main(int argc, char *argv[])
|
||||
#endif
|
||||
int fd;
|
||||
int errval = 0;
|
||||
#ifdef CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
/* If this example is configured as an NX add-on, then limit the number of
|
||||
* samples that we collect before returning. Otherwise, we never return
|
||||
@ -125,21 +121,6 @@ int tc_main(int argc, char *argv[])
|
||||
printf("tc_main: nsamples: %d\n", CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT
|
||||
/* Initialization of the touchscreen hardware is performed by logic
|
||||
* external to this test.
|
||||
*/
|
||||
|
||||
printf("tc_main: Initializing external touchscreen device\n");
|
||||
ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_EXAMPLES_TOUCHSCREEN_MINOR);
|
||||
if (ret != OK)
|
||||
{
|
||||
printf("tc_main: board_tsc_setup failed: %d\n", errno);
|
||||
errval = 1;
|
||||
goto errout;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Open the touchscreen device for reading */
|
||||
|
||||
printf("tc_main: Opening %s\n", CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH);
|
||||
|
Loading…
Reference in New Issue
Block a user