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.c b/modules/NUCLEO-F103RB/module.c
index 11fcafd..b147329 100644
--- a/modules/NUCLEO-F103RB/module.c
+++ b/modules/NUCLEO-F103RB/module.c
@@ -24,7 +24,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * @{
  */
 
-#include "module.h"
+#include <amiroos.h>
 
 /*===========================================================================*/
 /**
@@ -49,7 +49,7 @@ SerialConfig moduleHalProgIfConfig = {
   /* CR1      */ 0,
 };
 
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
 
 /*! SPI (high and low speed) configuration for DW1000 */
 SPIConfig moduleHalSpiUwbHsConfig = {
@@ -70,7 +70,7 @@ SPIConfig moduleHalSpiUwbLsConfig = {
   /* CR2                         */ 0,
 };
 
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /** @} */
 
@@ -85,7 +85,7 @@ SPIConfig moduleHalSpiUwbLsConfig = {
  * @brief   LED output signal GPIO.
  */
 static apalGpio_t _gpioLed = {
-  /* line */ PAL_LINE(GPIOA, GPIOA_LED_GREEN),
+  /* line */ LINE_LED_GREEN,
 };
 ROMCONST apalControlGpio_t moduleGpioLed = {
   /* GPIO */ &_gpioLed,
@@ -96,7 +96,7 @@ ROMCONST apalControlGpio_t moduleGpioLed = {
   },
 };
 
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
 
 /**
  * @brief   DW1000 reset output signal GPIO.
@@ -145,13 +145,13 @@ ROMCONST apalControlGpio_t moduleGpioSpiChipSelect = {
   },
 };
 
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /**
  * @brief   User button input signal GPIO.
  */
 static apalGpio_t _gpioUserButton = {
-  /* line */ PAL_LINE(GPIOC, GPIOC_BUTTON),
+  /* line */ LINE_BUTTON,
 };
 ROMCONST apalControlGpio_t moduleGpioUserButton = {
   /* GPIO */ &_gpioUserButton,
@@ -184,6 +184,7 @@ ROMCONST char* moduleShellPrompt = "NUCLEO-F103RB";
  */
 /*===========================================================================*/
 
+/** @} */
 
 /*===========================================================================*/
 /**
@@ -192,7 +193,7 @@ ROMCONST char* moduleShellPrompt = "NUCLEO-F103RB";
  */
 /*===========================================================================*/
 
-#if defined(AMIROLLD_CFG_DW1000)
+#if (BOARD_DW1000_CONNECTED == true)
 
 /*! @brief TODO: Manual implementation of SPI configuration. Somehow, it is necessary in NUCLEO-F103RB  */
 void dw1000_spi_init(void){
@@ -203,7 +204,7 @@ void dw1000_spi_init(void){
   apalGpioWrite(moduleGpioSpiChipSelect.gpio, APAL_GPIO_LOW);
 }
 
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
 /** @} */
 
 /*===========================================================================*/
@@ -213,7 +214,15 @@ void dw1000_spi_init(void){
  */
 /*===========================================================================*/
 
-#if defined(AMIROLLD_CFG_DW1000)
+LEDDriver moduleLldLed = {
+  /* LED enable Gpio */ &moduleGpioLed,
+};
+
+ButtonDriver moduleLldUserButton = {
+  /* Button Gpio  */ &moduleGpioUserButton,
+};
+
+#if (BOARD_DW1000_CONNECTED == true)
 
 DW1000Driver moduleLldDw1000 = {
   /* SPI driver         */ &MODULE_HAL_SPI_UWB,
@@ -221,18 +230,39 @@ DW1000Driver moduleLldDw1000 = {
   /* RESET DW1000       */ &moduleGpioDw1000Reset,
 };
 
-#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)
+/*
+ * LED
+ */
+#include <module_test_LED.h>
+static int _testLedShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestLedShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestLedShellCmd, "test:LED", _testLedShellCmdCb);
+
+/*
+ * User button
+ */
+#include <module_test_button.h>
+static int _testButtonShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestButtonShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestButtonShellCmd, "test:button", _testButtonShellCmdCb);
+
+#if (BOARD_DW1000_CONNECTED == true) || defined(__DOXYGEN__)
 
 /*
  * UwB Driver (DW1000)
@@ -255,7 +285,39 @@ aos_unittest_t moduleUtAlldDw1000 = {
   },
   /* data           */ &moduleLldDw1000,
 };
-#endif /* defined(AMIROLLD_CFG_DW1000) */
+#endif /* (BOARD_DW1000_CONNECTED == true) */
+
+/*
+ * entire module
+ */
+static int _testAllShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  (void)argc;
+  (void)argv;
+
+  int status = AOS_OK;
+  char* targv[AMIROOS_CFG_SHELL_MAXARGS] = {NULL};
+  aos_testresult_t result_test = {0, 0};
+  aos_testresult_t result_total = {0, 0};
+
+  /* LED */
+  status |= moduleTestLedShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* User button */
+  status |= moduleTestButtonShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* DW1000 */
+  //TODO
+
+  // print total result
+  chprintf(stream, "\n");
+  aosTestResultPrintSummary(stream, &result_total, "entire module");
+
+  return status;
+}
+AOS_SHELL_COMMAND(moduleTestAllShellCmd, "test:all", _testAllShellCmdCb);
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
