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/inc/aos_confcheck.h b/core/inc/aos_confcheck.h
index bf16754..9c5c774 100644
--- a/core/inc/aos_confcheck.h
+++ b/core/inc/aos_confcheck.h
@@ -53,31 +53,39 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * SSSP parameters and options
  */
 
-#ifndef AMIROOS_CFG_SSSP_MASTER
-  #error "AMIROOS_CFG_SSSP_MASTER not defined in aosconf.h"
+#ifndef AMIROOS_CFG_SSSP_ENABLE
+  #error "AMIROOS_CFG_SSSP_ENABLE not defined in aosconf.h"
 #endif
 
-#ifndef AMIROOS_CFG_SSSP_STACK_START
-  #error "AMIROOS_CFG_SSSP_STACK_START not defined in aosconf.h"
-#endif
+# if (AMIROOS_CFG_SSSP_ENABLE == true)
 
-#ifndef AMIROOS_CFG_SSSP_STACK_END
-  #error "AMIROOS_CFG_SSSP_STACK_END not defined in aosconf.h"
-#endif
+  #ifndef AMIROOS_CFG_SSSP_MASTER
+    #error "AMIROOS_CFG_SSSP_MASTER not defined in aosconf.h"
+  #endif
 
-#if (AMIROOS_CFG_SSSP_STACK_START == true) && (AMIROOS_CFG_SSSP_STACK_END == true)
-  #warning "AMIROOS_CFG_SSSP_STACK_START and AMIROOS_CFG_SSSP_STACK_END both enabled in aosconf.h"
-  #if (AMIROOS_CFG_SSSP_MASTER != true)
-    #error "AMIROOS_CFG_SSSP_MASTER must be enabled in this case"
+  #ifndef AMIROOS_CFG_SSSP_STACK_START
+    #error "AMIROOS_CFG_SSSP_STACK_START not defined in aosconf.h"
   #endif
-#endif
 
-#ifndef AMIROOS_CFG_SSSP_SIGNALDELAY
-  #error "AMIROOS_CFG_SSSP_SIGNALDELAY not defined in aosconf.h"
-#endif
+  #ifndef AMIROOS_CFG_SSSP_STACK_END
+    #error "AMIROOS_CFG_SSSP_STACK_END not defined in aosconf.h"
+  #endif
+
+  #if (AMIROOS_CFG_SSSP_STACK_START == true) && (AMIROOS_CFG_SSSP_STACK_END == true)
+    #warning "AMIROOS_CFG_SSSP_STACK_START and AMIROOS_CFG_SSSP_STACK_END both enabled in aosconf.h"
+    #if (AMIROOS_CFG_SSSP_MASTER != true)
+      #error "AMIROOS_CFG_SSSP_MASTER must be enabled in this case"
+    #endif
+  #endif
+
+  #ifndef AMIROOS_CFG_SSSP_SIGNALDELAY
+    #error "AMIROOS_CFG_SSSP_SIGNALDELAY not defined in aosconf.h"
+  #endif
+
+  #ifndef AMIROOS_CFG_SSSP_SYSSYNCPERIOD
+    #error "AMIROOS_CFG_SSSP_SYSSYNCPERIOD not defined in aosconf.h"
+  #endif
 
-#ifndef AMIROOS_CFG_SSSP_SYSSYNCPERIOD
-  #error "AMIROOS_CFG_SSSP_SYSSYNCPERIOD not defined in aosconf.h"
 #endif
 
 /*
diff --git a/core/inc/aos_system.h b/core/inc/aos_system.h
index d19c788..dc184b7 100644
--- a/core/inc/aos_system.h
+++ b/core/inc/aos_system.h
@@ -65,6 +65,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define AOS_SYSTEM_EVENTFLAGS_RESTART           (AOS_SYSTEM_EVENTFLAGS_SHUTDOWN | (eventflags_t)(1 << 4))
 
 /**
+ * @brief   Enumerator to identify shutdown types.
+ */
+typedef enum aos_shutdown {
+  AOS_SHUTDOWN_NONE,            /**< Default value if no shutdown action was initiated */
+  AOS_SHUTDOWN_PASSIVE,         /**< Passive shutdown (initiated by another module). */
+  AOS_SHUTDOWN_HIBERNATE,       /**< Active shutdown to hibernate mode. */
+  AOS_SHUTDOWN_DEEPSLEEP,       /**< Active shutdown to deepsleep mode. */
+  AOS_SHUTDOWN_TRANSPORTATION,  /**< Active shutdown to transportation mode. */
+  AOS_SHUTDOWN_RESTART,         /**< Active saystem restart request. */
+} aos_shutdown_t;
+
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+/**
  * @brief   Major version of the implemented SSSP.
  */
 #define AOS_SYSTEM_SSSP_VERSION_MAJOR           1
@@ -81,18 +95,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define AOS_SYSTEM_SSSP_TIMEOUT                 (10 * AMIROOS_CFG_SSSP_SIGNALDELAY)
 
 /**
- * @brief   Enumerator to identify shutdown types.
- */
-typedef enum aos_shutdown {
-  AOS_SHUTDOWN_NONE,            /**< Default value if no shutdown action was initiated */
-  AOS_SHUTDOWN_PASSIVE,         /**< Passive shutdown (initiated by another module). */
-  AOS_SHUTDOWN_HIBERNATE,       /**< Active shutdown to hibernate mode. */
-  AOS_SHUTDOWN_DEEPSLEEP,       /**< Active shutdown to deepsleep mode. */
-  AOS_SHUTDOWN_TRANSPORTATION,  /**< Active shutdown to transportation mode. */
-  AOS_SHUTDOWN_RESTART,         /**< Active saystem restart request. */
-} aos_shutdown_t;
-
-/**
  * @brief   Enumerator of the several stages of SSSP.
  */
 typedef enum aos_ssspstage {
@@ -119,11 +121,13 @@ typedef enum aos_ssspstage {
  */
 typedef uint16_t aos_ssspmoduleid_t;
 
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+
 /**
  * @brief   AMiRo-OS base system structure.
  */
 typedef struct aos_system {
-
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
   /**
    * @brief   SSSP relevant data.
    */
@@ -140,6 +144,7 @@ typedef struct aos_system {
      */
     aos_ssspmoduleid_t moduleId;
   } sssp;
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
   /**
    * @brief   System I/O stream.
@@ -192,7 +197,9 @@ extern "C" {
   void aosSysInit(void);
 #endif
   void aosSysStart(void);
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined (__DOXYGEN__)
   eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener);
+#endif
   void aosSysGetUptimeX(aos_timestamp_t* ut);
   void aosSysGetDateTime(struct tm* dt);
   void aosSysSetDateTime(struct tm* dt);
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 {
diff --git a/core/src/aos_system.c b/core/src/aos_system.c
index a2c829d..85c50fc 100644
--- a/core/src/aos_system.c
+++ b/core/src/aos_system.c
@@ -79,7 +79,7 @@ static aos_timestamp_t _uptime;
  */
 static systime_t _synctime;
 
-#if (AMIROOS_CFG_SSSP_MASTER == true) || defined(__DOXYGEN__)
+#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true)) || defined(__DOXYGEN__)
 /**
  * @brief   Timer to drive the SYS_SYNC signal for system wide time synchronization according to SSSP.
  */
@@ -91,7 +91,7 @@ static virtual_timer_t _syssynctimer;
 static aos_timestamp_t _syssynctime;
 #endif
 
-#if ((AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
+#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
 /**
  * @brief   Offset between local clock and system wide synchronization signal.
  */
@@ -101,7 +101,7 @@ static float _syssyncskew;
  * @brief   Weighting factor for the low-pass filter used for calculating the @p _syssyncskew value.
  */
 #define SYSTEM_SYSSYNCSKEW_LPFACTOR   (0.1f / AOS_SYSTEM_TIME_RESOLUTION)
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
@@ -250,7 +250,11 @@ static void _printSystemInfo(BaseSequentialStream* stream)
 #endif
   _printSystemInfoLine(stream, "Architecture", SYSTEM_INFO_NAMEWIDTH, "%s", PORT_ARCHITECTURE_NAME);
   _printSystemInfoSeparator(stream, '-', SYSTEM_INFO_WIDTH);
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   _printSystemInfoLine(stream, "AMiRo-OS" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s (SSSP %u.%u)", AMIROOS_VERSION_MAJOR, AMIROOS_VERSION_MINOR, AMIROOS_VERSION_PATCH, AMIROOS_RELEASE_TYPE, AOS_SYSTEM_SSSP_VERSION_MAJOR, AOS_SYSTEM_SSSP_VERSION_MINOR);
+#else
+  _printSystemInfoLine(stream, "AMiRo-OS" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s", AMIROOS_VERSION_MAJOR, AMIROOS_VERSION_MINOR, AMIROOS_VERSION_PATCH, AMIROOS_RELEASE_TYPE);
+#endif
   _printSystemInfoLine(stream, "AMiRo-LLD" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s (periphAL %u.%u)", AMIRO_LLD_VERSION_MAJOR, AMIRO_LLD_VERSION_MINOR, AMIRO_LLD_VERSION_PATCH, AMIRO_LLD_RELEASE_TYPE, PERIPHAL_VERSION_MAJOR, PERIPHAL_VERSION_MINOR);
   _printSystemInfoLine(stream, "ChibiOS/RT" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s", CH_KERNEL_MAJOR, CH_KERNEL_MINOR, CH_KERNEL_PATCH, (CH_KERNEL_STABLE == 1) ? "stable" : "non-stable");
   _printSystemInfoLine(stream, "ChibiOS/HAL", SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s", CH_HAL_MAJOR, CH_HAL_MINOR, CH_HAL_PATCH, (CH_HAL_STABLE == 1) ? "stable" : "non-stable");
@@ -269,6 +273,7 @@ static void _printSystemInfo(BaseSequentialStream* stream)
                          (BL_CALLBACK_TABLE_ADDRESS->vBootloader.identifier == BL_VERSION_ID_AMiRoBLT_PreAlpha) ? "pre-alpha" :
                          "<release type unknown>",
                          BL_CALLBACK_TABLE_ADDRESS->vSSSP.major, BL_CALLBACK_TABLE_ADDRESS->vSSSP.minor);
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
     if (BL_CALLBACK_TABLE_ADDRESS->vSSSP.major != AOS_SYSTEM_SSSP_VERSION_MAJOR) {
       if (stream) {
         chprintf(stream, "WARNING: Bootloader and AMiRo-OS implement incompatible SSSP versions!\n");
@@ -276,6 +281,7 @@ static void _printSystemInfo(BaseSequentialStream* stream)
         aosprintf("WARNING: Bootloader and AMiRo-OS implement incompatible SSSP versions!\n");
       }
     }
+#endif
     _printSystemInfoLine(stream, "Compiler", SYSTEM_INFO_NAMEWIDTH, "%s %u.%u.%u", (BL_CALLBACK_TABLE_ADDRESS->vCompiler.identifier == BL_VERSION_ID_GCC) ? "GCC" : "<compiler unknown>", BL_CALLBACK_TABLE_ADDRESS->vCompiler.major, BL_CALLBACK_TABLE_ADDRESS->vCompiler.minor, BL_CALLBACK_TABLE_ADDRESS->vCompiler.patch); // TODO: support other compilers than GCC
   } else {
     if (stream) {
@@ -287,11 +293,13 @@ static void _printSystemInfo(BaseSequentialStream* stream)
 
   // print dynamic information about the module
   _printSystemInfoSeparator(stream, '-', SYSTEM_INFO_WIDTH);
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   if (aos.sssp.moduleId != 0) {
     _printSystemInfoLine(stream, "Module ID", SYSTEM_INFO_NAMEWIDTH, "%u", aos.sssp.moduleId);
   } else {
     _printSystemInfoLine(stream, "Module ID", SYSTEM_INFO_NAMEWIDTH, "not available");
   }
+#endif
   _printSystemInfoLine(stream, "Date", SYSTEM_INFO_NAMEWIDTH, "%s %02u-%02u-%04u", (dt.tm_wday == 0) ? "Sunday" : (dt.tm_wday == 1) ? "Monday" : (dt.tm_wday == 2) ? "Tuesday" : (dt.tm_wday == 3) ? "Wednesday" : (dt.tm_wday == 4) ? "Thursday" : (dt.tm_wday == 5) ? "Friday" : "Saturday",
                        dt.tm_mday,
                        dt.tm_mon + 1,
@@ -500,7 +508,7 @@ static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]
   chprintf(stream, "%10u seconds\n", (uint8_t)(uptime % MICROSECONDS_PER_MINUTE / MICROSECONDS_PER_SECOND));
   chprintf(stream, "%10u milliseconds\n", (uint16_t)(uptime % MICROSECONDS_PER_SECOND / MICROSECONDS_PER_MILLISECOND));
   chprintf(stream, "%10u microseconds\n", (uint16_t)(uptime % MICROSECONDS_PER_MILLISECOND / MICROSECONDS_PER_MICROSECOND));
-#if (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)
+#if (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)
   chprintf(stream, "SSSP synchronization offset: %.3fus per %uus\n", _syssyncskew, AMIROOS_CFG_SSSP_SYSSYNCPERIOD);
 #endif /* AMIROOS_CFG_SSSP_MASTER != true && AMIROOS_CFG_PROFILE == true */
   _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
@@ -625,7 +633,7 @@ static void _intCallback(void* args)
   return;
 }
 
-#if (AMIROOS_CFG_SSSP_MASTER != true) || defined(__DOXYGEN__)
+#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true)) || defined(__DOXYGEN__)
 /**
  * @brief   Callback function for the Sync signal interrupt.
  *
@@ -667,7 +675,7 @@ static void _signalSyncCallback(void *args)
 
   return;
 }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) */
 
 /**
  * @brief   Callback function for the uptime accumulation timer.
@@ -691,7 +699,7 @@ static void _uptimeCallback(void* par)
   return;
 }
 
-#if (AMIROOS_CFG_SSSP_MASTER == true) || defined (__DOXYGEN__)
+#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true)) || defined (__DOXYGEN__)
 /**
  * @brief   Periodic system synchronization callback function.
  * @details Toggles the SYS_SYNC signal and reconfigures the system synchronization timer.
@@ -725,7 +733,7 @@ static void _sysSyncTimerCallback(void* par)
 
   return;
 }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true) */
 
 /**
  * @brief   AMiRo-OS system initialization.
@@ -744,6 +752,7 @@ void aosSysInit(void)
 
   /* set local variables */
   chVTObjectInit(&_systimer);
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   _synctime = 0;
   _uptime = 0;
 #if (AMIROOS_CFG_SSSP_MASTER == true)
@@ -753,15 +762,26 @@ void aosSysInit(void)
 #if (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)
   _syssyncskew = 0.0f;
 #endif
+#else /* AMIROOS_CFG_SSSP_ENABLE == false */
+  // start the uptime counter
+  chSysLock();
+  _synctime = chVTGetSystemTimeX();
+  _uptime = 0;
+  chVTSetI(&_systimer, SYSTIMER_PERIOD, &_uptimeCallback, NULL);
+  chSysUnlock();
+#endif /* AMIROOS_CFG_SSSP_ENABLE */
 
   /* initialize aos configuration */
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   aos.sssp.stage = AOS_SSSP_STARTUP_2_1;
   aos.sssp.moduleId = 0;
+#endif
   aosIOStreamInit(&aos.iostream);
   chEvtObjectInit(&aos.events.io);
   chEvtObjectInit(&aos.events.os);
 
   /* interrupt setup */
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   // PD signal
   palSetPadCallback(moduleSsspGpioPd.gpio->port, moduleSsspGpioPd.gpio->pad, _intCallback, &moduleSsspGpioPd.gpio->pad);
   palEnablePadEvent(moduleSsspGpioPd.gpio->port, moduleSsspGpioPd.gpio->pad, APAL2CH_EDGE(moduleSsspGpioPd.meta.edge));
@@ -782,6 +802,7 @@ void aosSysInit(void)
   palSetPadCallback(moduleSsspGpioUp.gpio->port, moduleSsspGpioUp.gpio->pad, _intCallback, &moduleSsspGpioUp.gpio->pad);
   palEnablePadEvent(moduleSsspGpioUp.gpio->port, moduleSsspGpioUp.gpio->pad, APAL2CH_EDGE(moduleSsspGpioUp.meta.edge));
 #endif
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 #ifdef MODULE_INIT_INTERRUPTS
   // further interrupt signals
   MODULE_INIT_INTERRUPTS();
@@ -803,7 +824,7 @@ void aosSysInit(void)
 #if (AMIROOS_CFG_TESTS_ENABLE == true)
   aosShellAddCommand(&aos.shell, &_shellcmd_kerneltest);
 #endif
-#endif
+#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
 
   return;
 }
@@ -813,6 +834,7 @@ void aosSysInit(void)
  */
 inline void aosSysStart(void)
 {
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   // update the system SSSP stage
   aos.sssp.stage = AOS_SSSP_OPERATION;
 
@@ -828,6 +850,7 @@ inline void aosSysStart(void)
     chSysUnlock();
   }
 #endif
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
   // print system information;
   _printSystemInfo((BaseSequentialStream*)&aos.iostream);
@@ -845,6 +868,7 @@ inline void aosSysStart(void)
   return;
 }
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Implements the SSSP startup synchronization step.
  *
@@ -895,6 +919,7 @@ eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener)
     return m;
   }
 }
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
 /**
  * @brief   Retrieves the system uptime.
@@ -953,6 +978,7 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
   // check arguments
   aosDbgCheck(shutdown != AOS_SHUTDOWN_NONE);
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
 #if (AMIROOS_CFG_SSSP_MASTER == true)
   // deactivate the system synchronization timer
   chVTReset(&_syssynctimer);
@@ -969,6 +995,7 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
   // activate the SYS_SYNC signal
   apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_ON);
   chSysUnlock();
+#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
 
   switch (shutdown) {
     case AOS_SHUTDOWN_PASSIVE:
@@ -997,8 +1024,10 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
       break;
   }
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   // update the system SSSP stage
   aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_2;
+#endif
 
   return;
 }
@@ -1037,8 +1066,10 @@ void aosSysShutdownFinal(aos_shutdown_t shutdown)
   // disable all interrupts
   irqDeinit();
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
   // update the system SSSP stage
   aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_3;
+#endif
 
   // call bootloader callback depending on arguments
   switch (shutdown) {
diff --git a/modules/DiWheelDrive_1-1/aosconf.h b/modules/DiWheelDrive_1-1/aosconf.h
index dec35f5..b90bf52 100644
--- a/modules/DiWheelDrive_1-1/aosconf.h
+++ b/modules/DiWheelDrive_1-1/aosconf.h
@@ -17,7 +17,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 /**
- * @file    
+ * @file
  * @brief   AMiRo-OS Configuration file for the DiWheelDrive v1.1 module.
  * @details Contains the application specific AMiRo-OS settings.
  *
@@ -98,6 +98,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /*===========================================================================*/
 
 /**
+ * @brief   Flag to enable SSSP.
+ */
+#if !defined(OS_CFG_SSSP_ENABLE)
+  #define AMIROOS_CFG_SSSP_ENABLE               true
+#else
+  #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/LightRing_1-0/aosconf.h b/modules/LightRing_1-0/aosconf.h
index 6ce5233..079fb35 100644
--- a/modules/LightRing_1-0/aosconf.h
+++ b/modules/LightRing_1-0/aosconf.h
@@ -98,6 +98,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /*===========================================================================*/
 
 /**
+ * @brief   Flag to enable SSSP.
+ */
+#if !defined(OS_CFG_SSSP_ENABLE)
+  #define AMIROOS_CFG_SSSP_ENABLE               true
+#else
+  #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/PowerManagement_1-1/aosconf.h b/modules/PowerManagement_1-1/aosconf.h
index c1c3aa9..4fd6633 100644
--- a/modules/PowerManagement_1-1/aosconf.h
+++ b/modules/PowerManagement_1-1/aosconf.h
@@ -98,6 +98,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /*===========================================================================*/
 
 /**
+ * @brief   Flag to enable SSSP.
+ */
+#if !defined(OS_CFG_SSSP_ENABLE)
+  #define AMIROOS_CFG_SSSP_ENABLE               true
+#else
+  #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
