commit 2920c6b7b164ac30bf1e3ab0e10cf6ccf9dee2d6
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Tue Jan 8 15:06:53 2019 +0100

    Enhanced the main thread IO event configuration.
    Therefore a new macro AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK has been introduced.

diff --git a/core/src/aos_main.cpp b/core/src/aos_main.cpp
index c7dc490..b7a857d 100644
--- a/core/src/aos_main.cpp
+++ b/core/src/aos_main.cpp
@@ -872,6 +872,7 @@ int main(void)
   // local variables
   eventmask_t eventmask = 0;
   eventflags_t eventflags = 0;
+  eventflags_t eventflagsmask = AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK;
   aos_shutdown_t shutdown = AOS_SHUTDOWN_NONE;
 #if defined(AMIROOS_CFG_MAIN_EXTRA_THREAD_VARIABLES)
   AMIROOS_CFG_MAIN_EXTRA_THREAD_VARIABLES
@@ -956,16 +957,17 @@ int main(void)
 
   /* 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)
-  chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC | MODULE_SSSP_EVENTFLAGS_UP);
-#elif (AMIROOS_CFG_SSSP_STACK_END == true)
-  chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC | MODULE_SSSP_EVENTFLAGS_DN);
-#else
-  chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC | MODULE_SSSP_EVENTFLAGS_DN | MODULE_SSSP_EVENTFLAGS_UP);
+  eventflagsmask |= MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC;
+#if (AMIROOS_CFG_SSSP_STACK_START != true)
+  eventflagsmask |= MODULE_SSSP_EVENTFLAGS_DN;
+#endif
+#if (AMIROOS_CFG_SSSP_STACK_END != true)
+  eventflagsmask |= MODULE_SSSP_EVENTFLAGS_UP;
 #endif
 #endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+  if (eventflagsmask != 0) {
+    chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, eventflagsmask);
+  }
   chEvtRegisterMask(&aos.events.os, &_eventListenerOS, OSEVENT_MASK);
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5)
diff --git a/modules/DiWheelDrive_1-1/aosconf.h b/modules/DiWheelDrive_1-1/aosconf.h
index d18db36..5f2d2f6 100644
--- a/modules/DiWheelDrive_1-1/aosconf.h
+++ b/modules/DiWheelDrive_1-1/aosconf.h
@@ -79,6 +79,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif
 
 /**
+ * @brief   Mask for the control thread to listen to certain IO events.
+ * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
+ */
+#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
+#else
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
+#endif
+
+/**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
  * @details A value of 0 deactivates the timeout.
  */
diff --git a/modules/LightRing_1-0/aosconf.h b/modules/LightRing_1-0/aosconf.h
index 34e5bbf..8c97bc0 100644
--- a/modules/LightRing_1-0/aosconf.h
+++ b/modules/LightRing_1-0/aosconf.h
@@ -79,6 +79,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif
 
 /**
+ * @brief   Mask for the control thread to listen to certain IO events.
+ * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
+ */
+#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
+#else
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
+#endif
+
+/**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
  * @details A value of 0 deactivates the timeout.
  */
diff --git a/modules/PowerManagement_1-1/aosconf.h b/modules/PowerManagement_1-1/aosconf.h
index 6403505..91a190d 100644
--- a/modules/PowerManagement_1-1/aosconf.h
+++ b/modules/PowerManagement_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 PowerManagement v1.1 module.
  * @details Contains the application specific AMiRo-OS settings.
  *
@@ -79,6 +79,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif
 
 /**
+ * @brief   Mask for the control thread to listen to certain IO events.
+ * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
+ */
+#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
+#else
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
+#endif
+
+/**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
  * @details A value of 0 deactivates the timeout.
  */
diff --git a/modules/STM32F4Discovery/aosconf.h b/modules/STM32F4Discovery/aosconf.h
index 503445a..6dced75 100644
--- a/modules/STM32F4Discovery/aosconf.h
+++ b/modules/STM32F4Discovery/aosconf.h
@@ -79,6 +79,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif
 
 /**
+ * @brief   Mask for the control thread to listen to certain IO events.
+ * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
+ */
+#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
+#else
+  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
+#endif
+
+/**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
  * @details A value of 0 deactivates the timeout.
  */
