commit cda1472944648652764c6980f5ee3f3e91459ef3
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Mon Oct 28 11:15:03 2019 +0100

    Major SSSP overhaul:
    - SSSP no works even without Bootloader (AMiRo-OS implements startup and shutdown phases)
    - MSI and calendar synchronization are currently not available (WIP)
    - lots of minor changes

diff --git a/modules/DiWheelDrive_1-2/module.h b/modules/DiWheelDrive_1-2/module.h
index 20cac86..27a751f 100644
--- a/modules/DiWheelDrive_1-2/module.h
+++ b/modules/DiWheelDrive_1-2/module.h
@@ -232,69 +232,68 @@ extern ROMCONST apalControlGpio_t moduleGpioSysWarmrst;
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
 /**
  * @brief   Event flag to be set on a SYS_WARMRST interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSWARMRST      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
 
 /**
  * @brief   Event flag to be set on a PATH_DCSTAT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT       AOS_IOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
+#define MODULE_OS_GPIOEVENTFLAG_PATHDCSTAT      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 /**
  * @brief   Event flag to be set on a SYS_REG_EN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSREGEN         AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSREGEN        AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
 
 /**
  * @brief   Event flag to be set on a IR_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IRINT            AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
+#define MODULE_OS_GPIOEVENTFLAG_IRINT           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_UP interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
 
 /**
  * @brief   Event flag to be set on a IMU_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IMUINT         AOS_IOEVENT_FLAG(PAL_PAD(LINE_IMU_INT))
+#define MODULE_OS_GPIOEVENTFLAG_IMUINT          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IMU_INT))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* IR_INT */                                                                \
-  palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt.gpio->line);  \
+  palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt.gpio->line);  \
   palEnableLineEvent(moduleGpioIrInt.gpio->line, APAL2CH_EDGE(moduleGpioIrInt.meta.edge));                  \
   /* IMU_INT */                                                               \
-  palSetLineCallback(moduleGpioImuInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioImuInt.gpio->line);  \
+  palSetLineCallback(moduleGpioImuInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioImuInt.gpio->line);  \
   palEnableLineEvent(moduleGpioImuInt.gpio->line, APAL2CH_EDGE(moduleGpioImuInt.meta.edge));                  \
   /* PATH_DCSTAT */                                                           \
-  palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioPathDcStat.gpio->line);  \
+  palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioPathDcStat.gpio->line);  \
   palEnableLineEvent(moduleGpioPathDcStat.gpio->line, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge));                  \
   /* SYS_REG_EN */                                                            \
-  palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysRegEn.gpio->line);  \
+  palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysRegEn.gpio->line);  \
   palEnableLineEvent(moduleGpioSysRegEn.gpio->line, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge));                  \
   /* SYS_WARMRST */                                                           \
-  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysWarmrst.gpio->line);  \
+  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysWarmrst.gpio->line);  \
   palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge));                  \
 }
 
@@ -302,7 +301,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestA3906ShellCmd);                   \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   /* TODO: add BNO055 test command */                                         \
@@ -337,12 +336,16 @@ extern ROMCONST char* moduleShellPrompt;
   qeiStart(&MODULE_HAL_QEI_RIGHT_WHEEL, &moduleHalQeiConfig);                 \
   qeiEnable(&MODULE_HAL_QEI_LEFT_WHEEL);                                      \
   qeiEnable(&MODULE_HAL_QEI_RIGHT_WHEEL);                                     \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
 }
 
 /**
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* PWM */                                                                   \
   pwmStop(&MODULE_HAL_PWM_DRIVE);                                             \
   /* QEI */                                                                   \
@@ -365,35 +368,39 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                      moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   UP signal GPIO.
  */
-#define moduleSsspGpioUp                        moduleGpioSysUartUp
+#define moduleSsspGpioUP                        moduleGpioSysUartUp
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for UP signal events.
+ * @brief   Event flag for UP signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_UP               MODULE_OS_IOEVENTFLAGS_SYSUARTUP
+#define MODULE_SSSP_EVENTFLAG_UP                MODULE_OS_GPIOEVENTFLAG_SYSUARTUP
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
