commit 4c72a54cb0b2745713595adaecfc1bad548c03e0
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Mon Jul 15 13:21:06 2019 +0200

    Massive overhaul:
    - updated to a new version of AMiRo-LLD
    - tests (formerly unit tests) are now split onto multiple parts:
      - there are "global" tests for each driver etc.
      - there is an individual part for each module, e.g. if there are multiple instances of the same periphery
    - a lot of minor enhancements

diff --git a/modules/NUCLEO-F103RB/module.h b/modules/NUCLEO-F103RB/module.h
index 344337c..4ede7fd 100644
--- a/modules/NUCLEO-F103RB/module.h
+++ b/modules/NUCLEO-F103RB/module.h
@@ -36,7 +36,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /*===========================================================================*/
 
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
 
 #if defined(__cplusplus)
 extern "C" {
@@ -48,7 +48,7 @@ void dw1000_spi_init(void);
 }
 #endif /* defined(__cplusplus) */
 
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 
 /** @} */
@@ -75,15 +75,13 @@ extern SerialConfig moduleHalProgIfConfig;
  */
 #define MODULE_HAL_RTC                          RTCD1
 
-
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
 
 /**
  * @brief   SPI interface driver for the motion sensors (gyroscope and accelerometer).
  */
 #define MODULE_HAL_SPI_UWB                      SPID2
 
-
 /**
  * @brief   Configuration for the SPI interface driver to communicate with the LED driver.
  */
@@ -94,11 +92,10 @@ extern SPIConfig moduleHalSpiUwbHsConfig;
  */
 extern SPIConfig moduleHalSpiUwbLsConfig;
 
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /** @} */
 
-
 /*===========================================================================*/
 /**
  * @name GPIO definitions
@@ -111,7 +108,8 @@ extern SPIConfig moduleHalSpiUwbLsConfig;
  */
 extern ROMCONST apalControlGpio_t moduleGpioLed;
 
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
+
 /**
  * @brief   DW1000 reset output signal
  * @note    the reset pin should be drived as low by MCU to activate.
@@ -130,7 +128,7 @@ extern ROMCONST apalControlGpio_t moduleGpioDw1000Irqn;
  */
 extern ROMCONST apalControlGpio_t moduleGpioSpiChipSelect ;
 
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /**
  * @brief   User button input signal.
@@ -146,17 +144,20 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
  */
 /*===========================================================================*/
 
+#if (BOARD_DW1000_CONNECTED == true)
+
 /**
  * @brief   Event flag to be call dwt_isr() interrupt.
  */
 #define MODULE_OS_IOEVENTFLAGS_DW1000_IRQn      AOS_IOEVENT_FLAG(PAL_PAD(LINE_ARD_D6))
 
+#endif /* (BOARD_DW1000_CONNECTED == true) */
+
 /**
  * @brief   Event flag to be set on a USER_BUTTON interrupt.
  */
 #define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
 
-
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
@@ -174,72 +175,75 @@ extern ROMCONST char* moduleShellPrompt;
   palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge));                \
   MODULE_INIT_INTERRUPTS_DW1000();                                            \
 }
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
   #define MODULE_INIT_INTERRUPTS_DW1000() {                                   \
     palSetLineCallback(moduleGpioDw1000Irqn.gpio->line, aosSysGetStdIntCallback(), &moduleGpioDw1000Irqn.gpio->line); \
     palEnableLineEvent(moduleGpioDw1000Irqn.gpio->line, APAL2CH_EDGE(moduleGpioDw1000Irqn.meta.edge));                \
   }
-#else /* defined(AMIROLLD_CFG_DW1000) */
+#else /* (BOARD_DW1000_CONNECTED == true) */
   #define MODULE_INIT_INTERRUPTS_DW1000() {                                   \
   }
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 
 /**
- * @brief   Unit test initialization hook.
+ * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* add unit-test shell commands */                                          \
+  /* initialize tests and add to shell */                                     \
+  aosShellAddCommand(&aos.shell, &moduleTestLedShellCmd);                     \
+  aosShellAddCommand(&aos.shell, &moduleTestButtonShellCmd);                  \
   MODULE_INIT_TESTS_DW1000();                                                 \
+  aosShellAddCommand(&aos.shell, &moduleTestAllShellCmd);                     \
 }
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
   #define MODULE_INIT_TESTS_DW1000() {                                        \
-    aosShellAddCommand(&aos.shell, &moduleUtAlldDw1000.shellcmd);             \
+    aosShellAddCommand(&aos.shell, &moduleTestDw1000ShellCmd);                \
   }
-#else /* defined(AMIROLLD_CFG_DW1000) */
+#else /* (BOARD_DW1000_CONNECTED == true) */
   #define MODULE_INIT_TESTS_DW1000() {                                        \
   }
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 
 /**
  * @brief   Periphery communication interfaces initialization hook.
  */
-#define MODULE_INIT_PERIPHERY_COMM() {                                        \
+#define MODULE_INIT_PERIPHERY_IF() {                                          \
   /* serial driver */                                                         \
   sdStart(&MODULE_HAL_PROGIF, &moduleHalProgIfConfig);                        \
-  MODULE_INIT_PERIPHERY_COMM_DW1000();                                        \
+  MODULE_INIT_PERIPHERY_IF_DW1000();                                          \
 }
-#if defined(AMIROLLD_CFG_DW1000)
-  #define MODULE_INIT_PERIPHERY_COMM_DW1000() {                               \
+#if (BOARD_DW1000_CONNECTED == true)
+  #define MODULE_INIT_PERIPHERY_IF_DW1000() {                                 \
     /* SPI init */                                                            \
     dw1000_spi_init();                                                        \
     spiStart(&MODULE_HAL_SPI_UWB, &moduleHalSpiUwbLsConfig);                  \
   }
-#else /* defined(AMIROLLD_CFG_DW1000) */
-  #define MODULE_INIT_PERIPHERY_COMM_DW1000() {                               \
+#else /* (BOARD_DW1000_CONNECTED == true) */
+  #define MODULE_INIT_PERIPHERY_IF_DW1000() {                                 \
   }
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 
 /**
  * @brief   Periphery communication interface deinitialization hook.
  */
-#define MODULE_SHUTDOWN_PERIPHERY_COMM() {                                    \
-  MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000();                                    \
+#define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  MODULE_SHUTDOWN_PERIPHERY_IF_DW1000();                                      \
 }
-#if defined(AMIROLLD_CFG_DW1000)
-#define MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000() {                             \
+#if (BOARD_DW1000_CONNECTED == true)
+#define MODULE_SHUTDOWN_PERIPHERY_IF_DW1000() {                               \
   /* SPI */                                                                   \
   spiStop(&MODULE_HAL_SPI_UWB);                                               \
 }
-#else /* defined(AMIROLLD_CFG_DW1000) */
-  #define MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000() {                           \
+#else /* (BOARD_DW1000_CONNECTED == true) */
+  #define MODULE_SHUTDOWN_PERIPHERY_IF_DW1000() {                             \
   }
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /**
- * @brief   HOOK to call process_deca_irq() func when the dw1000 interrupt pin is activated.
+ * @brief   HOOK to toggle the LEDs when the user button is pressed.
  */
 #define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {                               \
   if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) {                       \
@@ -249,17 +253,20 @@ extern ROMCONST char* moduleShellPrompt;
   }                                                                           \
   MODULE_MAIN_LOOP_IO_EVENT_DW1000();                                         \
 }
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
+  /**
+   * @brief   HOOK to call process_deca_irq() func when the dw1000 interrupt pin is activated.
+   */
   #define MODULE_MAIN_LOOP_IO_EVENT_DW1000() {                                \
     if(eventflags & MODULE_OS_IOEVENTFLAGS_DW1000_IRQn) {                     \
       /*apalGpioToggle(moduleGpioLedGreen.gpio); // just for debug  */        \
       process_deca_irq();                                                     \
     }                                                                         \
   }
-#else /* defined(AMIROLLD_CFG_DW1000) */
+#else /* (BOARD_DW1000_CONNECTED == true) */
   #define MODULE_MAIN_LOOP_IO_EVENT_DW1000() {                                \
   }
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /** @} */
 
@@ -278,32 +285,60 @@ extern ROMCONST char* moduleShellPrompt;
  * @{
  */
 /*===========================================================================*/
-#if defined(AMIROLLD_CFG_DW1000)
+#include <alld_LED.h>
+#include <alld_button.h>
+
+/**
+ * @brief   LED driver.
+ */
+extern LEDDriver moduleLldLed;
+
+/**
+ * @brief   Button driver.
+ */
+extern ButtonDriver moduleLldUserButton;
+
+#if (BOARD_DW1000_CONNECTED == true)
+
 #include <alld_DW1000.h>
 
 extern DW1000Driver moduleLldDw1000;
 
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /** @} */
 
 /*===========================================================================*/
 /**
- * @name Unit tests (UT)
+ * @name Tests
  * @{
  */
 /*===========================================================================*/
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
-#if defined(AMIROLLD_CFG_DW1000) && (AMIROLLD_CFG_DW1000 == 1)
-#include <ut_alld_DW1000_v1.h>
+/**
+ * @brief   LED test command.
+ */
+extern aos_shellcommand_t moduleTestLedShellCmd;
+
+/**
+ * @brief   User button test command.
+ */
+extern aos_shellcommand_t moduleTestButtonShellCmd;
+
+#if (BOARD_DW1000_CONNECTED == true)
 
 /**
- * @brief   DW1000 unit test object.
+ * @brief   DW1000 (UWB transmitter) test command.
  */
-extern aos_unittest_t moduleUtAlldDw1000;
+extern aos_shellcommand_t moduleTestDw1000ShellCmd;
 
-#endif /* defined(AMIROLLD_CFG_DW1000) && (AMIROLLD_CFG_DW1000 == 1) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
+
+/**
+ * @brief   Entire module test command.
+ */
+extern aos_shellcommand_t moduleTestAllShellCmd;
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
