Make sure that FPU test, HID keyboard example, and touchscreen options are only available in the FLAT build

This commit is contained in:
Gregory Nutt 2015-03-23 19:03:51 -06:00
parent 7fccf7de1b
commit 83e4bc2f7d
3 changed files with 19 additions and 3 deletions

View File

@ -6,6 +6,7 @@
config EXAMPLES_HIDKBD config EXAMPLES_HIDKBD
bool "USB HID keyboard example" bool "USB HID keyboard example"
default n default n
depends on !BUILD_PROTECTED && !BUILD_KERNEL
---help--- ---help---
Enable the USB HID keyboard example Enable the USB HID keyboard example

View File

@ -55,7 +55,10 @@
#undef HAVE_FPU #undef HAVE_FPU
#ifdef CONFIG_ARCH_FPU #ifdef CONFIG_ARCH_FPU
# if defined(CONFIG_EXAMPLES_OSTEST_FPUSIZE) && defined(CONFIG_SCHED_WAITPID) && !defined(CONFIG_DISABLE_SIGNALS) # if defined(CONFIG_EXAMPLES_OSTEST_FPUSIZE) && \
defined(CONFIG_SCHED_WAITPID) && \
!defined(CONFIG_DISABLE_SIGNALS) && \
defined(CONFIG_BUILD_FLAT)
# define HAVE_FPU 1 # define HAVE_FPU 1
# else # else
# ifndef CONFIG_EXAMPLES_OSTEST_FPUSIZE # ifndef CONFIG_EXAMPLES_OSTEST_FPUSIZE
@ -67,6 +70,9 @@
# ifdef CONFIG_DISABLE_SIGNALS # ifdef CONFIG_DISABLE_SIGNALS
# warning "FPU test not built; CONFIG_DISABLE_SIGNALS defined" # warning "FPU test not built; CONFIG_DISABLE_SIGNALS defined"
# endif # endif
# ifndef CONFIG_BUILD_FLAT
# warning "FPU test not built; Only available in the flat build (CONFIG_BUILD_FLAT)"
# endif
# endif # endif
#endif #endif
@ -88,7 +94,7 @@
# define CONFIG_EXAMPLES_OSTEST_FPUSTACKSIZE 2048 # define CONFIG_EXAMPLES_OSTEST_FPUSTACKSIZE 2048
#endif #endif
/* Other defintions ****************************************************/ /* Other definitions ***************************************************/
/* We'll keep all data using 32-bit values only to force 32-bit alignment. /* We'll keep all data using 32-bit values only to force 32-bit alignment.
* This logic has no real notion of the underlying representation. * This logic has no real notion of the underlying representation.
*/ */

View File

@ -46,6 +46,7 @@ config EXAMPLES_TOUCHSCREEN_MOUSE
config EXAMPLES_TOUCHSCREEN_ARCHINIT config EXAMPLES_TOUCHSCREEN_ARCHINIT
bool "Architecture-specific initialization" bool "Architecture-specific initialization"
default y default y
depends on !BUILD_PROTECTED && !BUILD_KERNEL
---help--- ---help---
By default, the touchscreen example will call arch_tcinitialize() to By default, the touchscreen example will call arch_tcinitialize() to
register the touchscreen device before it attempts to open it. register the touchscreen device before it attempts to open it.
@ -54,7 +55,7 @@ config EXAMPLES_TOUCHSCREEN_ARCHINIT
This works well for the typical touchscreen controller but there are This works well for the typical touchscreen controller but there are
other devices that cannot be initialized and uninitialized in this other devices that cannot be initialized and uninitialized in this
fashion. Consider a USB mouse, fo example. The USB mouse will be fashion. Consider a USB mouse, for example. The USB mouse will be
registered when the mouse is connected and unregistered when the registered when the mouse is connected and unregistered when the
mouse is disconnected. mouse is disconnected.
@ -64,4 +65,12 @@ config EXAMPLES_TOUCHSCREEN_ARCHINIT
de-selected, then the arch_tcinitialize() and arch_tcuninitialize() will de-selected, then the arch_tcinitialize() and arch_tcuninitialize() will
never be called. never be called.
NOTE also that the functions arch_tcinitialize() and
arch_tcuninitialize() are effective non-standard operating system
calls. This is cheap shortcut and a violation of the OS interface.
You can get away with this in the flat build (CONFIG_BUILD_FLAT),
but not in the protected or kernel builds (CONFIG_BUILD_PROTECTED
or CONFIG)BUILD_KERNEL). In those cases, you will need to perform
one-time touchscreen initialization in board_initialize().
endif endif