From e69358670cafecfd6304d75263491e8dea5f33c5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 17 Jan 2018 12:02:39 -0600 Subject: [PATCH] In NxWM unit test, call boardctl(BOARDIOC_INIT) if available and appropriate. --- UnitTests/nxwm/nxwm_main.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 07fa8f464..3dddea009 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -43,6 +43,8 @@ #include #include +#include + #ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA # include "platform/configdata.hr" #endif @@ -675,6 +677,16 @@ int nxwm_main(int argc, char *argv[]) up_cxxinitialize(); #endif + // Should we perform board-specific initialization? There are two ways + // that board initialization can occur: 1) automatically via + // board_initialize() durring bootup if CONFIG_BOARD_INITIALIZE, or + // 2) here via a call to boardctl() if the interface is enabledi + // (CONFIG_LIB_BOARDCTL=y). + +#if defined(CONFIG_LIB_BOARDCTL) && !defined(CONFIG_BOARD_INITIALIZE) + (void)boardctl(BOARDIOC_INIT, 0); +#endif + // Initialize memory monitor logic initMemoryUsage(); @@ -688,6 +700,7 @@ int nxwm_main(int argc, char *argv[]) printf("nxwm_main: ERROR: Failed to initialize the NSH library\n"); return EXIT_FAILURE; } + showTestCaseMemory("nxwm_main: After initializing the NSH library"); #endif