commit 9ebb11a928808941ac7870e1cbdbf5678acc11c7
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Wed Dec 12 14:05:09 2018 +0100

    Introduced a switch to completely disable SSSP (thanks to S. Welzel)

diff --git a/core/src/aos_main.cpp b/core/src/aos_main.cpp
index 68ab754..4c1f77d 100644
--- a/core/src/aos_main.cpp
+++ b/core/src/aos_main.cpp
@@ -61,6 +61,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define DELAYEVENT_MASK                         EVENT_MASK(4)
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   CAN message identifier for initialization of the SSSP stack initialization sequence.
  */
@@ -76,6 +78,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define SSSP_STACKINIT_CANMSGID_ABORT           0x001
 
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+
 /**
  * @brief   CAN message identifier for calender synchronization message.
  */
@@ -129,6 +133,7 @@ static inline void _unexpectedEventError(const eventmask_t mask, const eventflag
   return;
 }
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Callback function to be used during SSSP stack initialization sequence.
  *
@@ -144,6 +149,7 @@ static void _ssspTimerCallback(void* par)
 
   return;
 }
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
 /**
  * @brief   Helper function to serialize data.
@@ -242,6 +248,7 @@ inline void _U642TM(struct tm* dst, const uint64_t src)
   return;
 }
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Implementation of the SSSP module stack initialization sequence (startup phase 3).
  *
@@ -404,9 +411,9 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
         aosDbgPrintf("PD evt\n");
         // deactivate S and UP
         apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-  #if (AMIROOS_CFG_SSSP_STACK_END != true)
+#if (AMIROOS_CFG_SSSP_STACK_END != true)
         apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_OFF);
-  #endif
+#endif
         // set shutdown flag and exit the loop
         shutdown = AOS_SHUTDOWN_PASSIVE;
         break;
@@ -837,6 +844,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
 
   return shutdown;
 }
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
 /**
  * @brief   Application entry point.
@@ -929,6 +937,7 @@ int main(void)
 #endif
 
   /* event associations */
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
 #if (AMIROOS_CFG_SSSP_STACK_START == true) && (AMIROOS_CFG_SSSP_STACK_END == true)
   chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC);
 #elif (AMIROOS_CFG_SSSP_STACK_START == true)
@@ -938,6 +947,7 @@ int main(void)
 #else
   chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC | MODULE_SSSP_EVENTFLAGS_DN | MODULE_SSSP_EVENTFLAGS_UP);
 #endif
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
   chEvtRegisterMask(&aos.events.os, &_eventListenerOS, OSEVENT_MASK);
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5)
@@ -1001,6 +1011,7 @@ int main(void)
 #endif
 #endif
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   /* SSSP startup OS synchronization phase (end of startup stage 2) */
   while ((shutdown == AOS_SHUTDOWN_NONE) && (eventmask = aosSysSsspStartupOsInitSyncCheck(&_eventListenerIO)) != 0) {
     /*
@@ -1040,12 +1051,14 @@ int main(void)
   if (shutdown == AOS_SHUTDOWN_NONE) {
     shutdown = _ssspModuleStackInitialization();
   }
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
   /*
    * There must be no delays at this point, thus no hook is allowed.
    */
 
-  /* snychronize calendars */
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
+  /* synchronize calendars */
   if (shutdown == AOS_SHUTDOWN_NONE) {
 #if (AMIROOS_CFG_SSSP_MASTER == true)
     CANTxFrame frame;
@@ -1068,7 +1081,7 @@ int main(void)
     canTransmitTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &frame, TIME_IMMEDIATE);
 
     aosDbgPrintf("done\n");
-#else
+#else /* AMIROOS_CFG_SSSP_MASTER == false */
     CANRxFrame frame;
     uint64_t encoded;
     struct tm t;
@@ -1094,9 +1107,10 @@ int main(void)
     } else {
       aosDbgPrintf("fail (timeout)\n");
     }
-#endif
+#endif /* AMIROOS_CFG_SSSP_MASTER == false */
     aosDbgPrintf("\n");
   }
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_8)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS)
@@ -1147,10 +1161,12 @@ int main(void)
       case IOEVENT_MASK:
         // evaluate flags
         eventflags = chEvtGetAndClearFlags(&_eventListenerIO);
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
         // PD event
         if (eventflags & MODULE_SSSP_EVENTFLAGS_PD) {
           shutdown = AOS_SHUTDOWN_PASSIVE;
         }
+#endif
         // all other events
 #ifdef MODULE_MAIN_LOOP_IO_EVENT
         else {
