commit 510b93ccf3818200d52dfc72f9aa66acd27ab6db
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Mon Oct 28 15:48:46 2019 +0100

    Several fixed to the recent SSSP overhaul

diff --git a/core/src/aos_sssp.c b/core/src/aos_sssp.c
index 683dd79..c058862 100644
--- a/core/src/aos_sssp.c
+++ b/core/src/aos_sssp.c
@@ -44,8 +44,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* LOCAL VARIABLES                                                            */
 /******************************************************************************/
 
-#if (AMIROOS_CFG_SSSP_MASTER == true) || defined (__DOXYGEN__)
-
 /**
  * @brief   A timer event based delays.
  */
@@ -61,14 +59,10 @@ static event_source_t _eventSourceDelay;
  */
 static event_listener_t _eventListenerDelay;
 
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-
 /******************************************************************************/
 /* LOCAL FUNCTIONS                                                            */
 /******************************************************************************/
 
-#if (AMIROOS_CFG_SSSP_MASTER == true) || defined (__DOXYGEN__)
-
 /**
  * @brief   General callback function to be used for any local timers.
  *
@@ -85,8 +79,6 @@ static void _timerCallback(void* par)
   return;
 }
 
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-
 /**
  * @brief   Waits for the S signal to switch to the desired state.
  *
@@ -120,8 +112,6 @@ static inline aos_status_t _waitForS(event_listener_t* listener, eventflags_t fl
   return AOS_FAILURE;
 }
 
-#if (AMIROOS_CFG_SSSP_MASTER == true) || defined(__DOXYGEN__)
-
 /**
  * @brief   Uses the local delay timer to setup a timed event and waits for it to fire.
  *
@@ -156,8 +146,6 @@ static inline aos_status_t _delay(uint32_t dt, eventmask_t mask, bool arm_timer,
   return AOS_FAILURE;
 }
 
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-
 /******************************************************************************/
 /* EXPORTED FUNCTIONS                                                         */
 /******************************************************************************/
@@ -167,48 +155,39 @@ static inline aos_status_t _delay(uint32_t dt, eventmask_t mask, bool arm_timer,
  */
 void aosSsspInit(void)
 {
-#if (AMIROOS_CFG_SSSP_MSI == true)
-  // module ID is initialized as 'invalid'
-  aos.sssp.moduleId = AOS_SSSP_MODULEID_INVALID;
-#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
+  // local variables
+  apalControlGpioState_t state;
 
 #if (AMIROOS_CFG_SSSP_STARTUP == true)
   // AMiRo-OS has to perform the basic initialization
   aos.sssp.stage = AOS_SSSP_STAGE_STARTUP_1_1;
-#if (AMIROOS_CFG_DBG == true)
-  // check whether the initial signal configuration is correct
-  {
-    apalControlGpioState_t state;
-    // S signal
-    apalControlGpioGet(&moduleSsspGpioS, &state);
-    aosDbgAssert(state == APAL_GPIO_ON);
-    // PD signal
-    apalControlGpioGet(&moduleSsspGpioPD, &state);
-    aosDbgAssert(state == APAL_GPIO_OFF);
-  }
-#endif /* (AMIROOS_CFG_DBG == true) */
 #else /* (AMIROOS_CFG_SSSP_STARTUP == true) */
   // basic initialization was already performed by a bootloader
   aos.sssp.stage = AOS_SSSP_STAGE_STARTUP_2_1;
-#if (AMIROOS_CFG_DBG == true)
-  // check whether the initial signal configuration is correct
-  {
-    apalControlGpioState_t state;
-    // S signal
-    apalControlGpioGet(&moduleSsspGpioS, &state);
-    aosDbgAssert(state == APAL_GPIO_ON);
-    // PD signal
-    apalControlGpioGet(&moduleSsspGpioPD, &state);
-    aosDbgAssert(state == APAL_GPIO_OFF);
-  }
-#endif /* (AMIROOS_CFG_DBG == true) */
 #endif /* (AMIROOS_CFG_SSSP_STARTUP == true) */
 
-#if (AMIROOS_CFG_SSSP_MASTER == true)
+  // check all SSSP signals for correct state
+  apalControlGpioGet(&moduleSsspGpioS, &state);
+  aosDbgAssert(state == APAL_GPIO_ON);
+  apalControlGpioGet(&moduleSsspGpioPD, &state);
+  aosDbgAssert(state == APAL_GPIO_OFF);
+#if (AMIROOS_CFG_SSSP_STACK_END != true)
+  apalControlGpioGet(&moduleSsspGpioUP, &state);
+  aosDbgAssert(state == APAL_GPIO_OFF);
+#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
+#if (AMIROOS_CFG_SSSP_STACK_START != true)
+  apalControlGpioGet(&moduleSsspGpioDN, &state);
+  aosDbgAssert(state == APAL_GPIO_OFF);
+#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
+
+#if (AMIROOS_CFG_SSSP_MSI == true)
+  // module ID is initialized as 'invalid'
+  aos.sssp.moduleId = AOS_SSSP_MODULEID_INVALID;
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
+
   // initialize static variables
   chVTObjectInit(&_delayTimer);
   chEvtObjectInit(&_eventSourceDelay);
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
 
   return;
 }
