commit 7de0cc90a3bd7145a5160729fddc72a9aa46d330
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Thu Feb 21 18:04:04 2019 +0100

    All preprocessor directives without arguments (e.g. #endif) are now followed by a comment, indicating where it belongs to (e.g. the preceding #if).

diff --git a/core/inc/aos_confcheck.h b/core/inc/aos_confcheck.h
index 70451f6..5f9f5f1 100644
--- a/core/inc/aos_confcheck.h
+++ b/core/inc/aos_confcheck.h
@@ -43,90 +43,90 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /* kernel parameters and options */
 
-#ifndef AMIROOS_CFG_DBG
+#if !defined(AMIROOS_CFG_DBG)
   #error "AMIROOS_CFG_DBG not defined in aosconf.h"
-#endif
+#endif /* !defined(AMIROOS_CFG_DBG) */
 
-#ifndef AMIROOS_CFG_TESTS_ENABLE
+#if !defined(AMIROOS_CFG_TESTS_ENABLE)
   #error "AMIROOS_CFG_TESTS_ENABLE not defined in aosconf.h"
-#endif
+#endif /* !defined(AMIROOS_CFG_TESTS_ENABLE) */
 
-#ifndef AMIROOS_CFG_PROFILE
+#if !defined(AMIROOS_CFG_PROFILE)
   #error "AMIROOS_CFG_PROFILE not defined in aosconf.h"
-#endif
+#endif /* !defined(AMIROOS_CFG_PROFILE) */
 
-#ifndef AMIROOS_CFG_MAIN_LOOP_TIMEOUT
+#if !defined(AMIROOS_CFG_MAIN_LOOP_TIMEOUT)
   #error "AMIROOS_CFG_MAIN_LOOP_TIMEOUT not defined in aosconf.h"
-#endif
+#endif /* !defined(AMIROOS_CFG_MAIN_LOOP_TIMEOUT) */
 
 /* SSSP parameters and options */
 
-#ifndef AMIROOS_CFG_SSSP_ENABLE
+#if !defined(AMIROOS_CFG_SSSP_ENABLE)
   #error "AMIROOS_CFG_SSSP_ENABLE not defined in aosconf.h"
-#endif
+#endif /* !defined(AMIROOS_CFG_SSSP_ENABLE) */
 
 # if (AMIROOS_CFG_SSSP_ENABLE == true)
 
-  #ifndef AMIROOS_CFG_SSSP_MASTER
+  #if !defined(AMIROOS_CFG_SSSP_MASTER)
     #error "AMIROOS_CFG_SSSP_MASTER not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SSSP_MASTER) */
 
-  #ifndef AMIROOS_CFG_SSSP_STACK_START
+  #if !defined(AMIROOS_CFG_SSSP_STACK_START)
     #error "AMIROOS_CFG_SSSP_STACK_START not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SSSP_STACK_START) */
 
-  #ifndef AMIROOS_CFG_SSSP_STACK_END
+  #if !defined(AMIROOS_CFG_SSSP_STACK_END)
     #error "AMIROOS_CFG_SSSP_STACK_END not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SSSP_STACK_END) */
 
   #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
+    #endif /* (AMIROOS_CFG_SSSP_MASTER != true) */
+  #endif /* (AMIROOS_CFG_SSSP_STACK_START == true) && (AMIROOS_CFG_SSSP_STACK_END == true) */
 
-  #ifndef AMIROOS_CFG_SSSP_SIGNALDELAY
+  #if !defined(AMIROOS_CFG_SSSP_SIGNALDELAY)
     #error "AMIROOS_CFG_SSSP_SIGNALDELAY not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SSSP_SIGNALDELAY) */
 
-  #ifndef AMIROOS_CFG_SSSP_SYSSYNCPERIOD
+  #if !defined(AMIROOS_CFG_SSSP_SYSSYNCPERIOD)
     #error "AMIROOS_CFG_SSSP_SYSSYNCPERIOD not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SSSP_SYSSYNCPERIOD) */
 
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /* system shell options */
 
-#ifndef AMIROOS_CFG_SHELL_ENABLE
+#if !defined(AMIROOS_CFG_SHELL_ENABLE)
   #error "AMIROOS_CFG_SHELL_ENABLE not defined in aosconf.h"
-#endif
+#endif /* !defined(AMIROOS_CFG_SHELL_ENABLE) */
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true)
 
-  #ifndef AMIROOS_CFG_SHELL_STACKSIZE
+  #if !defined(AMIROOS_CFG_SHELL_STACKSIZE)
     #error "AMIROOS_CFG_SHELL_STACKSIZE not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SHELL_STACKSIZE) */
 
-  #ifndef AMIROOS_CFG_SHELL_THREADPRIO
+  #if !defined(AMIROOS_CFG_SHELL_THREADPRIO)
     #error "AMIROOS_CFG_SHELL_THREADPRIO not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SHELL_THREADPRIO) */
 
-  #ifndef AMIROOS_CFG_SHELL_LINEWIDTH
+  #if !defined(AMIROOS_CFG_SHELL_LINEWIDTH)
     #error "AMIROOS_CFG_SHELL_LINEWIDTH not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SHELL_LINEWIDTH) */
 
-  #ifndef AMIROOS_CFG_SHELL_MAXARGS
+  #if !defined(AMIROOS_CFG_SHELL_MAXARGS)
     #error "AMIROOS_CFG_SHELL_MAXARGS not defined in aosconf.h"
-  #endif
+  #endif /* !defined(AMIROOS_CFG_SHELL_MAXARGS) */
 
-#else /* AMIROOS_CFG_SHELL_ENABLE == false */
+#else /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
   #if (AMIROOS_CFG_TESTS_ENABLE == true)
     #pragma message "AMiRo-OS shell enabled implicitely via AMIROOS_CFG_TESTS_ENABLE"
-  #endif
+  #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
-#endif /* AMIROOS_CFG_SHELL_ENABLE */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /******************************************************************************/
 /* DATA STRUCTURES AND TYPES                                                  */
diff --git a/core/inc/aos_debug.h b/core/inc/aos_debug.h
index dd55c7a..b994f85 100644
--- a/core/inc/aos_debug.h
+++ b/core/inc/aos_debug.h
@@ -98,7 +98,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
   }                                                                           \
 }
 
-#else /* (AMIROOS_CFG_DBG != true) */
+#else /* (AMIROOS_CFG_DBG == true) */
 
 #define aosDbgPrintf(fmt, ...) {                          \
   (void)(fmt);                                            \
@@ -117,7 +117,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
   (void)(r);                                              \
 }
 
-#endif /* AMIROOS_CFG_DBG */
+#endif /* (AMIROOS_CFG_DBG == true) */
 
 /******************************************************************************/
 /* EXTERN DECLARATIONS                                                        */
diff --git a/core/inc/aos_iostream.h b/core/inc/aos_iostream.h
index 9e65adc..4f72d9c 100644
--- a/core/inc/aos_iostream.h
+++ b/core/inc/aos_iostream.h
@@ -142,9 +142,9 @@ typedef struct aos_ostream {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   void aosIOStreamInit(AosIOStream* stream);
   void aosIOChannelInit(AosIOChannel* channel, BaseAsynchronousChannel* asyncchannel);
   void aosIOStreamAddChannel(AosIOStream* stream, AosIOChannel* channel);
@@ -153,9 +153,9 @@ extern "C" {
   void aosIOChannelInputDisable(AosIOChannel* channel);
   void aosIOChannelOutputEnable(AosIOChannel* channel);
   void aosIOChannelOutputDisable(AosIOChannel* channel);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/core/inc/aos_shell.h b/core/inc/aos_shell.h
index 34675f0..a2d8f5b 100644
--- a/core/inc/aos_shell.h
+++ b/core/inc/aos_shell.h
@@ -367,9 +367,9 @@ typedef struct aos_shell {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   void aosShellInit(aos_shell_t* shell, event_source_t* oseventsource, const char* prompt, char* line, size_t linesize, char** arglist, size_t arglistsize);
   void aosShellStreamInit(AosShellStream* stream);
   void aosShellChannelInit(AosShellChannel* channel, BaseAsynchronousChannel* asyncchannel);
@@ -383,9 +383,9 @@ extern "C" {
   void aosShellChannelOutputEnable(AosShellChannel* channel);
   void aosShellChannelOutputDisable(AosShellChannel* channel);
   THD_FUNCTION(aosShellThread, shell);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/core/inc/aos_system.h b/core/inc/aos_system.h
index af6e0f8..dab3c8e 100644
--- a/core/inc/aos_system.h
+++ b/core/inc/aos_system.h
@@ -82,7 +82,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define AOS_SYSTEM_SSSP_TIMEOUT                 (10 * AMIROOS_CFG_SSSP_SIGNALDELAY)
 
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /******************************************************************************/
 /* SETTINGS                                                                   */
@@ -137,7 +137,7 @@ typedef enum aos_ssspstage {
  */
 typedef uint16_t aos_ssspmoduleid_t;
 
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /**
  * @brief   AMiRo-OS base system structure.
@@ -160,7 +160,7 @@ typedef struct aos_system {
      */
     aos_ssspmoduleid_t moduleId;
   } sssp;
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   /**
    * @brief   System I/O stream.
@@ -184,11 +184,13 @@ typedef struct aos_system {
   } events;
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+
   /**
    * @brief   Pointer to the shell object.
    */
   aos_shell_t shell;
-#endif
+
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 } aos_system_t;
 
@@ -212,30 +214,30 @@ typedef struct aos_system {
  */
 extern aos_system_t aos;
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
   void aosSysInit(const char* shellPrompt);
-#else
+#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
   void aosSysInit(void);
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
   void aosSysStart(void);
 #if (AMIROOS_CFG_SSSP_ENABLE == true) || defined (__DOXYGEN__)
   eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   void aosSysGetUptimeX(aos_timestamp_t* ut);
 #if (HAL_USE_RTC == TRUE)
   void aosSysGetDateTime(struct tm* dt);
   void aosSysSetDateTime(struct tm* dt);
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
   void aosSysShutdownInit(aos_shutdown_t shutdown);
   void aosSysStop(void);
   void aosSysDeinit(void);
   void aosSysShutdownFinal(aos_shutdown_t shutdown);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/core/inc/aos_thread.h b/core/inc/aos_thread.h
index 182e75d..4a1946d 100644
--- a/core/inc/aos_thread.h
+++ b/core/inc/aos_thread.h
@@ -118,16 +118,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(_cplusplus) */
   void aosThdSleepUntilS(const aos_timestamp_t t);
 #if (AMIROOS_CFG_DBG == true) && (CH_DBG_FILL_THREADS == TRUE)
   size_t aosThdGetStackPeakUtilization(thread_t* thread);
-#endif
-#ifdef __cplusplus
+#endif /* (AMIROOS_CFG_DBG == true) && (CH_DBG_FILL_THREADS == TRUE) */
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(_cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
@@ -292,7 +292,7 @@ inline size_t aosThdGetStacksize(thread_t* thread)
          ((size_t)PORT_GUARD_PAGE_SIZE + sizeof(struct port_intctx) + sizeof(struct port_extctx) + (size_t)PORT_INT_REQUIRED_STACK);
 }
 
-#endif /* AMIROOS_CFG_DBG == true */
+#endif /* (AMIROOS_CFG_DBG == true) */
 
 #endif /* AMIROOS_THREAD_H */
 
diff --git a/core/inc/aos_time.h b/core/inc/aos_time.h
index 7d40c93..399a46d 100644
--- a/core/inc/aos_time.h
+++ b/core/inc/aos_time.h
@@ -236,13 +236,13 @@ typedef aos_timestamp_t aos_longinterval_t;
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   uint8_t aosTimeDayOfWeekFromDate(const uint16_t day, const uint8_t month, const uint16_t year);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/core/inc/aos_timer.h b/core/inc/aos_timer.h
index 4a5f33a..c4544e6 100644
--- a/core/inc/aos_timer.h
+++ b/core/inc/aos_timer.h
@@ -123,9 +123,9 @@ typedef struct aos_periodictimer {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   void aosTimerInit(aos_timer_t* timer);
   void aosTimerSetAbsoluteI(aos_timer_t* timer, aos_timestamp_t* uptime, vtfunc_t cb, void* par);
   void aosTimerSetIntervalI(aos_timer_t* timer, aos_interval_t offset, vtfunc_t cb, void* par);
@@ -133,9 +133,9 @@ extern "C" {
   void aosPeriodicTimerInit(aos_periodictimer_t* ptimer);
   void aosPeriodicTimerSetI(aos_periodictimer_t* ptimer, aos_interval_t interval, vtfunc_t cb, void* par);
   void aosPeriodicTimerSetLongI(aos_periodictimer_t* ptimer, aos_longinterval_t* interval, vtfunc_t cb, void* par);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/core/inc/aos_unittest.h b/core/inc/aos_unittest.h
index 6643609..a3e7631 100644
--- a/core/inc/aos_unittest.h
+++ b/core/inc/aos_unittest.h
@@ -117,9 +117,9 @@ struct aos_unittest {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   uint32_t aosUtResultTotal(aos_utresult_t* result);
   float aosUtResultRatio(aos_utresult_t* result);
   void aosUtResultPrintSummary(BaseSequentialStream* stream, aos_utresult_t* result, char* heading);
@@ -130,15 +130,15 @@ extern "C" {
   void aosUtFailed(BaseSequentialStream* stream, aos_utresult_t* result);
   void aosUtFailedMsg(BaseSequentialStream* stream, aos_utresult_t* result, const char* fmt, ...);
   void aosUtInfoMsg(BaseSequentialStream* stream, const char* fmt, ...);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
 /******************************************************************************/
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 #endif /* AMIROOS_UNITTEST_H */
 
diff --git a/core/src/aos_main.cpp b/core/src/aos_main.cpp
index 30cbe06..c340429 100644
--- a/core/src/aos_main.cpp
+++ b/core/src/aos_main.cpp
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if defined(AMIROOS_CFG_MAIN_EXTRA_INCLUDE_HEADER)
 #include AMIROOS_CFG_MAIN_EXTRA_INCLUDE_HEADER
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_EXTRA_INCLUDE_HEADER) */
 
 /******************************************************************************/
 /* LOCAL DEFINITIONS                                                          */
@@ -81,14 +81,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define SSSP_STACKINIT_CANMSGID_ABORT           0x001
 
-#else /* AMIROOS_CFG_SSSP_ENABLE == false */
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /**
  * @brief   Default shutdown mode if SSSP is unavailable.
  */
 #define AOS_SHUTDOWN_DEFAULT                    AOS_SHUTDOWN_DEEPSLEEP
 
-#endif /* AMIROOS_CFG_SSSP_ENABLE */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /**
  * @brief   CAN message identifier for calender synchronization message.
@@ -136,7 +136,7 @@ static AosShellChannel _stdshellchannel;
  */
 #if defined(AMIROOS_CFG_MAIN_EXTRA_STATIC_VARIABLES)
 AMIROOS_CFG_MAIN_EXTRA_STATIC_VARIABLES
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_EXTRA_STATIC_VARIABLES) */
 
 /******************************************************************************/
 /* LOCAL FUNCTIONS                                                            */
@@ -152,10 +152,10 @@ static inline void _unexpectedEventError(const eventmask_t mask, const eventflag
 {
 #if (AMIROOS_CFG_DBG == true)
   aosprintf("CTRL: unexpected/unknown event received. mask: 0x%08X; flags: 0x%08X\n", mask, flags);
-#else
+#else /* (AMIROOS_CFG_DBG == true) */
   (void)(mask);
   (void)(flags);
-#endif
+#endif /* (AMIROOS_CFG_DBG == true) */
   return;
 }
 
@@ -175,7 +175,7 @@ static void _ssspTimerCallback(void* par)
 
   return;
 }
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /**
  * @brief   Helper function to serialize data.
@@ -276,7 +276,7 @@ inline void _U642TM(struct tm* dst, const uint64_t src)
   return;
 }
 
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
 
 #if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
 /**
@@ -325,7 +325,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
   CANRxFrame canRxFrame;
 #if (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true)
   aos_ssspmoduleid_t lastid = 0;
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true) */
   flags_t flags;
   aos_timestamp_t uptime;
 
@@ -405,7 +405,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
         aosDbgPrintf(">>> 3-4 (abort)\n");
         break;
     }
-#endif
+#endif /* (AMIROOS_CFG_DBG == true) */
 
     // reset wfe flag for the next iteration
     flags.wfe_next = true;
@@ -446,7 +446,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
 #if (AMIROOS_CFG_SSSP_STACK_END != true)
         aosDbgPrintf("disabling UP\n");
         apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_OFF);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
         // set shutdown flag and exit the loop
         shutdown = AOS_SHUTDOWN_PASSIVE;
         break;
@@ -474,11 +474,11 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
       // get the flags
       eventflags_t oseventflags = chEvtGetAndClearFlags(&_eventListenerOS);
       // there should be no OS events at this point
-#ifdef MODULE_SSSP_STARTUP_3_OSEVENT_HOOK
+#if defined(MODULE_SSSP_STARTUP_3_OSEVENT_HOOK)
       MODULE_SSSP_STARTUP_3_OSEVENT_HOOK(eventmask, eventflags);
-#else
+#else /* defined(MODULE_SSSP_STARTUP_3_OSEVENT_HOOK) */
       _unexpectedEventError(eventmask, oseventflags);
-#endif
+#endif /* defined(MODULE_SSSP_STARTUP_3_OSEVENT_HOOK) */
     }
     // if a CAN event occurred
     if ((eventmask & eventListenerCan.events)) {
@@ -536,16 +536,16 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
           // proceed immediately
           stage = STAGE_3_2;
           flags.wfe_next = false;
-#else
+#else /* (AMIROOS_CFG_SSSP_STACK_START == true) */
           // set the timeout timer
           chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
           // proceed
           stage = STAGE_3_3_WAITFORFIRSTID;
-#endif
-#else
+#endif /* (AMIROOS_CFG_SSSP_STACK_START == true) */
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
           // set the timeout timer
           chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
         }
 
 #if (AMIROOS_CFG_SSSP_MASTER != true)
@@ -568,15 +568,15 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
             // proceed
             stage = STAGE_3_2;
             flags.wfe_next = false;
-#else
+#else /* (AMIROOS_CFG_SSSP_STACK_START == true) */
             // set the timeout timer
             chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
             // proceed
             stage = STAGE_3_3_WAITFORFIRSTID;
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START == true) */
           }
         }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_MASTER != true) */
 
         break;
       } /* end of STAGE_3_1 */
@@ -599,9 +599,9 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
             chEvtBroadcast(&eventSourceTimeout);
             break;
           }
-#if (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true)
+#if (AMIROOS_CFG_DBG == true)
           lastid = aos.sssp.moduleId;
-#endif
+#endif /* (AMIROOS_CFG_DBG == true) */
 #if (AMIROOS_CFG_SSSP_STACK_END == true)
           // sequence is already over
           // deactivate S
@@ -609,10 +609,10 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
           apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
           // proceed
           stage = STAGE_3_3_WAITFORID;
-#else
+#else /* (AMIROOS_CFG_SSSP_STACK_END == true) */
           // set the delay timer so the UP signal is activated later
           chVTSet(&timerDelay, chTimeUS2I(AMIROOS_CFG_SSSP_SIGNALDELAY), _ssspTimerCallback, &eventSourceDelay);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_END == true) */
         }
 
         // if a delay event occurred
@@ -629,7 +629,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
           // proceed
           stage = STAGE_3_3_WAITFORID;
         }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START == true) */
 
         break;
       } /* end of STAGE_3_2 */
@@ -666,7 +666,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
             eventmask &= ~(eventListenerTimeout.events);
           }
         }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
         break;
       } /* end of STAGE_3_3_WAITFORFIRSTID */
 
@@ -728,7 +728,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
           // activate UP
           aosDbgPrintf("enabling UP\n");
           apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_ON);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
           // deactivate S
           aosDbgPrintf("disabling S\n");
           apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
@@ -739,7 +739,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
           // proceed
           stage = STAGE_3_3_WAITFORID;
         }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
 
         break;
       } /* end of STAGE_3_3_WAITFORIDORSIG */
@@ -760,14 +760,14 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
             // Plausibility of the received ID is not checked at this point but is done by other modules still in a previous stage.
             lastid = _deserialize(canRxFrame.data8, 4);
             aosDbgPrintf("ID (%u)\n", lastid);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true) */
             // restart timeout timer
             chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
             chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
             eventmask &= ~(eventListenerTimeout.events);
           }
         }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
 
         break;
       } /* end of STAGE_3_3_WAITFORID */
@@ -877,7 +877,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
 #if (AMIROOS_CFG_SSSP_STACK_END != true)
   aosDbgPrintf("disabling UP\n");
   apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_OFF);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
   aosDbgPrintf("disabling S\n");
   apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
   aosSysGetUptime(&uptime);
@@ -885,7 +885,7 @@ aos_shutdown_t _ssspModuleStackInitialization(void)
 
   return shutdown;
 }
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /**
  * @brief   Application entry point.
@@ -899,7 +899,7 @@ int main(void)
   aos_shutdown_t shutdown = AOS_SHUTDOWN_NONE;
 #if defined(AMIROOS_CFG_MAIN_EXTRA_THREAD_VARIABLES)
   AMIROOS_CFG_MAIN_EXTRA_THREAD_VARIABLES
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_EXTRA_THREAD_VARIABLES) */
 
   /*
    * ##########################################################################
@@ -910,68 +910,68 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_0)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_0(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_0();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_0) */
 
   /* hardware, kernel, and operating system initialization */
   // ChibiOS/HAL and custom hal additions (if any)
   halInit();
-#ifdef MODULE_INIT_HAL_EXTRA
+#if defined(MODULE_INIT_HAL_EXTRA)
   MODULE_INIT_HAL_EXTRA();
-#endif
+#endif /* defined(MODULE_INIT_HAL_EXTRA) */
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_1)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_1(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_1();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1) */
 
   // ChibiOS/RT kernel and custom kernel additions (if any)
   chSysInit();
-#ifdef MODULE_INIT_KERNEL_EXTRA
+#if defined(MODULE_INIT_KERNEL_EXTRA)
   MODULE_INIT_KERNEL_EXTRA();
-#endif
+#endif /* defined(MODULE_INIT_KERNEL_EXTRA) */
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_2)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_2(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_2();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2) */
 
   // AMiRo-OS and custom OS additions (if any)
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
   aosSysInit(moduleShellPrompt);
-#else
+#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
   aosSysInit();
-#endif
-#ifdef MODULE_INIT_OS_EXTRA
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#if defined(MODULE_INIT_OS_EXTRA)
   MODULE_INIT_OS_EXTRA();
-#endif
+#endif /* defined(MODULE_INIT_OS_EXTRA) */
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_3)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_3(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_3();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3) */
 
   /* event associations */
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   ioeventflagsmask |= MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC;
 #if (AMIROOS_CFG_SSSP_STACK_START != true)
   ioeventflagsmask |= MODULE_SSSP_EVENTFLAGS_DN;
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
 #if (AMIROOS_CFG_SSSP_STACK_END != true)
   ioeventflagsmask |= MODULE_SSSP_EVENTFLAGS_UP;
-#endif
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   if (ioeventflagsmask != 0) {
     chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, ioeventflagsmask);
   }
@@ -980,22 +980,22 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_4)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_4(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_4();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4) */
 
   /* periphery communication initialization */
   // module specific initialization (if any)
-#ifdef MODULE_INIT_PERIPHERY_COMM
+#if defined(MODULE_INIT_PERIPHERY_COMM)
   MODULE_INIT_PERIPHERY_COMM();
-#endif
+#endif /* defined(MODULE_INIT_PERIPHERY_COMM) */
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   // CAN (mandatory)
   canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   // user interface (if any)
-#ifdef MODULE_HAL_PROGIF
+#if defined(MODULE_HAL_PROGIF)
   aosIOChannelInit(&_stdiochannel, (BaseAsynchronousChannel*)&MODULE_HAL_PROGIF);
   aosIOChannelOutputEnable(&_stdiochannel);
   aosIOStreamAddChannel(&aos.iostream, &_stdiochannel);
@@ -1004,16 +1004,16 @@ int main(void)
   aosShellChannelInputEnable(&_stdshellchannel);
   aosShellChannelOutputEnable(&_stdshellchannel);
   aosShellStreamAddChannel(&aos.shell.stream, &_stdshellchannel);
-#endif
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* defined(MODULE_HAL_PROGIF) */
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_5(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_5();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5) */
 
   /* module is ready -> print welcome prompt */
   aosprintf("\n");
@@ -1035,26 +1035,26 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_6)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_6(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_6();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_6) */
 
 #if (AMIROOS_CFG_TESTS_ENABLE == true)
 #if defined(MODULE_INIT_TESTS)
   MODULE_INIT_TESTS();
-#else
-  #warning "MODULE_INIT_TESTS() not defined"
-#endif
-#endif
+#else /* defined(MODULE_INIT_TESTS) */
+  #warning "AMIROOS_CFG_TESTS_ENABLE set to true, but MODULE_INIT_TESTS() not defined"
+#endif /* defined(MODULE_INIT_TESTS) */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_7)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_7(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_7();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_7) */
 
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   /* SSSP startup OS synchronization phase (end of startup stage 2) */
@@ -1070,11 +1070,11 @@ int main(void)
       if (eventflags & MODULE_SSSP_EVENTFLAGS_PD) {
         shutdown = AOS_SHUTDOWN_PASSIVE;
       } else {
-#ifdef MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK
+#if defined(MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK)
         MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK(eventmask, eventflags);
-#else
+#else /* defined(MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK) */
         // ignore any other IO events
-#endif
+#endif /* defined(MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK) */
       }
     }
     // OS event
@@ -1096,7 +1096,7 @@ int main(void)
   if (shutdown == AOS_SHUTDOWN_NONE) {
     shutdown = _ssspModuleStackInitialization();
   }
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   /*
    * There must be no delays at this point, thus no hook is allowed.
@@ -1126,7 +1126,7 @@ int main(void)
     canTransmitTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &frame, TIME_IMMEDIATE);
 
     aosDbgPrintf("done\n");
-#else /* AMIROOS_CFG_SSSP_MASTER == false */
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
     CANRxFrame frame;
     uint64_t encoded;
     struct tm t;
@@ -1136,9 +1136,9 @@ int main(void)
 #if (AMIROOS_CFG_DBG == true)
     // increase timeout in debug mode due to additional delays introduced by the many prinf() calls
     if (canReceiveTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &frame, chTimeUS2I(10 * AOS_SYSTEM_SSSP_TIMEOUT)) == MSG_OK) {
-#else
+#else /* (AMIROOS_CFG_DBG == true) */
     if (canReceiveTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &frame, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT)) == MSG_OK) {
-#endif
+#endif /* (AMIROOS_CFG_DBG == true) */
       // validate message
       if (frame.DLC == 8 &&
           frame.RTR == CAN_RTR_DATA &&
@@ -1157,7 +1157,7 @@ int main(void)
     } else {
       aosDbgPrintf("fail (timeout)\n");
     }
-#endif /* AMIROOS_CFG_SSSP_MASTER == false */
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
     aosDbgPrintf("\n");
   }
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (HAL_USE_RTC == TRUE) */
@@ -1165,10 +1165,10 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_8)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_8(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_8();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_8) */
 
   /* completely start AMiRo-OS */
   if (shutdown == AOS_SHUTDOWN_NONE) {
@@ -1178,10 +1178,10 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_9)
 #if defined(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS)
   AMIROOS_CFG_MAIN_INIT_HOOK_9(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS) */
   AMIROOS_CFG_MAIN_INIT_HOOK_9();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_9) */
 
   /*
    * ##########################################################################
@@ -1194,17 +1194,17 @@ int main(void)
     // wait for an event
 #if (AMIROOS_CFG_MAIN_LOOP_TIMEOUT != 0)
     eventmask = chEvtWaitOneTimeout(ALL_EVENTS, chTimeUS2I(AMIROOS_CFG_MAIN_LOOP_TIMEOUT));
-#else
+#else /* (AMIROOS_CFG_MAIN_LOOP_TIMEOUT != 0) */
     eventmask = chEvtWaitOne(ALL_EVENTS);
-#endif
+#endif /* (AMIROOS_CFG_MAIN_LOOP_TIMEOUT != 0) */
 
 #if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0)
 #if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS)
     AMIROOS_CFG_MAIN_LOOP_HOOK_0(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS) */
     AMIROOS_CFG_MAIN_LOOP_HOOK_0();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0) */
 
     switch (eventmask) {
       // if this was an I/O event
@@ -1217,16 +1217,16 @@ int main(void)
           shutdown = AOS_SHUTDOWN_PASSIVE;
         }
         // all other events
-#ifdef MODULE_MAIN_LOOP_IO_EVENT
+#if defined(MODULE_MAIN_LOOP_IO_EVENT)
         else {
           MODULE_MAIN_LOOP_IO_EVENT(eventflags);
         }
-#endif
-#else /* AMIROOS_CFG_SSSP_ENABLE == false */
-#ifdef MODULE_MAIN_LOOP_IO_EVENT
+#endif /* defined(MODULE_MAIN_LOOP_IO_EVENT) */
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#if defined(MODULE_MAIN_LOOP_IO_EVENT)
         MODULE_MAIN_LOOP_IO_EVENT(eventflags);
-#endif
-#endif /* AMIROOS_CFG_SSSP_ENABLE */
+#endif /* defined(MODULE_MAIN_LOOP_IO_EVENT) */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
         break;
 
       // if this was an OS event
@@ -1247,11 +1247,11 @@ int main(void)
           case AOS_SYSTEM_EVENTFLAGS_RESTART:
             shutdown = AOS_SHUTDOWN_RESTART;
             break;
-#else /* AMIROOS_CFG_SSSP_ENABLE == false */
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
           case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN:
             shutdown = AOS_SHUTDOWN_DEFAULT;
             break;
-#endif /* AMIROOS_CFG_SSSP_ENABLE */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
           default:
             _unexpectedEventError(eventmask, eventflags);
             break;
@@ -1263,17 +1263,17 @@ int main(void)
         eventflags = 0;
 #if (AMIROOS_CFG_MAIN_LOOP_TIMEOUT == 0)
         _unexpectedEventError(eventmask, eventflags);
-#endif
+#endif /* (AMIROOS_CFG_MAIN_LOOP_TIMEOUT == 0) */
         break;
     }
 
 #if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1)
 #if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS)
     AMIROOS_CFG_MAIN_LOOP_HOOK_1(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS) */
     AMIROOS_CFG_MAIN_LOOP_HOOK_1();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1) */
   }
 
   /*
@@ -1285,10 +1285,10 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS)
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS) */
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0) */
 
   // initialize/acknowledge shutdown
   aosSysShutdownInit(shutdown);
@@ -1296,10 +1296,10 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS)
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS) */
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1) */
 
   // stop system threads
   aosSysStop();
@@ -1307,10 +1307,10 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS)
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS) */
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2) */
 
   // deinitialize system
   aosSysDeinit();
@@ -1318,27 +1318,27 @@ int main(void)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS)
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS) */
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3) */
 
   /* stop all periphery communication */
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   // CAN (mandatory)
   canStop(&MODULE_HAL_CAN);
-#endif
-#ifdef MODULE_SHUTDOWN_PERIPHERY_COMM
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#if defined(MODULE_SHUTDOWN_PERIPHERY_COMM)
   MODULE_SHUTDOWN_PERIPHERY_COMM();
-#endif
+#endif /* defined(MODULE_SHUTDOWN_PERIPHERY_COMM) */
 
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS)
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS);
-#else
+#else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS) */
     AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4();
-#endif
-#endif
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4) */
 
   // finally hand over to bootloader
   aosSysShutdownFinal(shutdown);
diff --git a/core/src/aos_shell.c b/core/src/aos_shell.c
index bcffddd..111fad5 100644
--- a/core/src/aos_shell.c
+++ b/core/src/aos_shell.c
@@ -336,7 +336,7 @@ static void _printPrompt(aos_shell_t* shell)
                dt.tm_min,
                dt.tm_sec);
     }
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
     else {
       aosDbgAssert(false);
     }
diff --git a/core/src/aos_system.c b/core/src/aos_system.c
index a94e367..bfb201f 100644
--- a/core/src/aos_system.c
+++ b/core/src/aos_system.c
@@ -34,7 +34,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #if (AMIROOS_CFG_TESTS_ENABLE == true)
 #include <ch_test.h>
 #include <rt_test_root.h>
-#endif
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /******************************************************************************/
 /* LOCAL DEFINITIONS                                                          */
@@ -90,7 +90,7 @@ static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]
 static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* argv[]);
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 static int _shellcmd_kerneltestcb(BaseSequentialStream* stream, int argc, char* argv[]);
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 #endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /**
@@ -168,9 +168,9 @@ static aos_shellcommand_t _shellcmd_config = {
 static aos_shellcommand_t _shellcmd_shutdown = {
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   /* name     */ "system:shutdown",
-#else
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   /* name     */ "module:shutdown",
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   /* callback */ _shellcmd_shutdowncb,
   /* next     */ NULL,
 };
@@ -184,7 +184,7 @@ static aos_shellcommand_t _shellcmd_kerneltest = {
   /* callback */ _shellcmd_kerneltestcb,
   /* next     */ NULL,
 };
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 #endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /******************************************************************************/
@@ -263,24 +263,24 @@ static void _printSystemInfo(BaseSequentialStream* stream)
 #if (HAL_USE_RTC == TRUE)
   struct tm dt;
   aosSysGetDateTime(&dt);
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
 
   // print static information about module and operating system
   _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
   _printSystemInfoLine(stream, "Module", SYSTEM_INFO_NAMEWIDTH, "%s", BOARD_NAME);
-#ifdef PLATFORM_NAME
+#if defined(PLATFORM_NAME)
   _printSystemInfoLine(stream, "Platform", SYSTEM_INFO_NAMEWIDTH, "%s", PLATFORM_NAME);
-#endif
-#ifdef PORT_CORE_VARIANT_NAME
+#endif /* defined(PLATFORM_NAME) */
+#if defined(PORT_CORE_VARIANT_NAME)
   _printSystemInfoLine(stream, "Core Variant", SYSTEM_INFO_NAMEWIDTH, "%s", PORT_CORE_VARIANT_NAME);
-#endif
+#endif /* defined(PORT_CORE_VARIANT_NAME) */
   _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
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   _printSystemInfoLine(stream, "AMiRo-OS" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s", AMIROOS_VERSION_MAJOR, AMIROOS_VERSION_MINOR, AMIROOS_VERSION_PATCH, AMIROOS_RELEASE_TYPE);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   _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");
@@ -307,7 +307,7 @@ static void _printSystemInfo(BaseSequentialStream* stream)
         aosprintf("WARNING: Bootloader and AMiRo-OS implement incompatible SSSP versions!\n");
       }
     }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
     _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) {
@@ -325,14 +325,14 @@ static void _printSystemInfo(BaseSequentialStream* stream)
   } else {
     _printSystemInfoLine(stream, "Module ID", SYSTEM_INFO_NAMEWIDTH, "not available");
   }
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 #if (HAL_USE_RTC == TRUE)
   _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,
                        dt.tm_year + 1900);
   _printSystemInfoLine(stream, "Time", SYSTEM_INFO_NAMEWIDTH, "%02u:%02u:%02u", dt.tm_hour, dt.tm_min, dt.tm_sec);
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
 
   _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
 
@@ -475,7 +475,7 @@ static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv
 
       retval = AOS_OK;
     }
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
   }
 
   // print help, if required
@@ -501,7 +501,7 @@ static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv
     chprintf(stream, "      hour\n");
     chprintf(stream, "      minute\n");
     chprintf(stream, "      second\n");
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
   }
 
   return (argc > 1 && strcmp(argv[1], "--help") == 0) ? AOS_OK : retval;
@@ -542,7 +542,7 @@ static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]
   chprintf(stream, "%10u microseconds\n", (uint16_t)(uptime % MICROSECONDS_PER_MILLISECOND / MICROSECONDS_PER_MICROSECOND));
 #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 */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */
   _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
 
   // print shell info
@@ -554,8 +554,8 @@ static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]
   chprintf(stream, "\tthread stack size:      %u bytes\n", aosThdGetStacksize(aos.shell.thread));
 #if (CH_DBG_FILL_THREADS == TRUE)
   chprintf(stream, "\tstack peak utilization: %u bytes (%.2f%%)\n", aosThdGetStackPeakUtilization(aos.shell.thread), (float)aosThdGetStackPeakUtilization(aos.shell.thread) / (float)aosThdGetStacksize(aos.shell.thread) * 100.0f);
-#endif /* CH_DBG_FILL_THREADS == TRUE */
-#endif /* AMIROOS_CFG_DBG == true */
+#endif /* (CH_DBG_FILL_THREADS == TRUE) */
+#endif /* (AMIROOS_CFG_DBG == true) */
   _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
 
   return AOS_OK;
@@ -624,14 +624,14 @@ static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* ar
       return AOS_INVALID_ARGUMENTS;
     }
   }
-#else /* AMIROOS_CFG_SSSP_ENABLE == false */
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   (void)argv;
   (void)argc;
 
   chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN);
   chThdTerminate(chThdGetSelfX());
   return AOS_OK;
-#endif /* AMIROOS_CFG_SSSP_ENABLE */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 }
 
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
@@ -655,7 +655,7 @@ static int _shellcmd_kerneltestcb(BaseSequentialStream* stream, int argc, char*
 
   return retval;
 }
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 #endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 // suppress warning in case no interrupt GPIOs are defined
@@ -705,12 +705,12 @@ static void _signalSyncCallback(void *args)
         _uptime -= uptime % AMIROOS_CFG_SSSP_SYSSYNCPERIOD;
 #if (AMIROOS_CFG_PROFILE == true)
         _syssyncskew = ((1.0f - SYSTEM_SYSSYNCSKEW_LPFACTOR) * _syssyncskew) + (SYSTEM_SYSSYNCSKEW_LPFACTOR * (uptime % AMIROOS_CFG_SSSP_SYSSYNCPERIOD));
-#endif
+#endif /* (AMIROOS_CFG_PROFILE == true) */
       } else {
         _uptime += AMIROOS_CFG_SSSP_SYSSYNCPERIOD - (uptime % AMIROOS_CFG_SSSP_SYSSYNCPERIOD);
 #if (AMIROOS_CFG_PROFILE == true)
         _syssyncskew = ((1.0f - SYSTEM_SYSSYNCSKEW_LPFACTOR) * _syssyncskew) - (SYSTEM_SYSSYNCSKEW_LPFACTOR * (AMIROOS_CFG_SSSP_SYSSYNCPERIOD - (uptime % AMIROOS_CFG_SSSP_SYSSYNCPERIOD)));
-#endif
+#endif /* (AMIROOS_CFG_PROFILE == true) */
       }
     }
   }
@@ -792,9 +792,9 @@ static void _sysSyncTimerCallback(void* par)
  */
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 void aosSysInit(const char* shellPrompt)
-#else
+#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 void aosSysInit(void)
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 {
   /* set control thread to maximum priority */
   chThdSetPriority(AOS_THD_CTRLPRIO);
@@ -807,24 +807,24 @@ void aosSysInit(void)
 #if (AMIROOS_CFG_SSSP_MASTER == true)
   chVTObjectInit(&_syssynctimer);
   _syssynctime = 0;
-#endif
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
 #if (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)
   _syssyncskew = 0.0f;
-#endif
-#else /* AMIROOS_CFG_SSSP_ENABLE == false */
+#endif /* (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   // start the uptime counter
   chSysLock();
   _synctime = chVTGetSystemTimeX();
   _uptime = 0;
   chVTSetI(&_systimer, SYSTIMER_PERIOD, &_uptimeCallback, NULL);
   chSysUnlock();
-#endif /* AMIROOS_CFG_SSSP_ENABLE */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   /* initialize aos configuration */
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   aos.sssp.stage = AOS_SSSP_STARTUP_2_1;
   aos.sssp.moduleId = 0;
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   aosIOStreamInit(&aos.iostream);
   chEvtObjectInit(&aos.events.io);
   chEvtObjectInit(&aos.events.os);
@@ -837,25 +837,25 @@ void aosSysInit(void)
   // SYNC signal
 #if (AMIROOS_CFG_SSSP_MASTER == true)
   palSetPadCallback(moduleSsspGpioSync.gpio->port, moduleSsspGpioSync.gpio->pad, _intCallback, &moduleSsspGpioSync.gpio->pad);
-#else
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
   palSetPadCallback(moduleSsspGpioSync.gpio->port, moduleSsspGpioSync.gpio->pad, _signalSyncCallback, &moduleSsspGpioSync.gpio->pad);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
   palEnablePadEvent(moduleSsspGpioSync.gpio->port, moduleSsspGpioSync.gpio->pad, APAL2CH_EDGE(moduleSsspGpioSync.meta.edge));
 #if (AMIROOS_CFG_SSSP_STACK_START != true)
   // DN signal
   palSetPadCallback(moduleSsspGpioDn.gpio->port, moduleSsspGpioDn.gpio->pad, _intCallback, &moduleSsspGpioDn.gpio->pad);
   palEnablePadEvent(moduleSsspGpioDn.gpio->port, moduleSsspGpioDn.gpio->pad, APAL2CH_EDGE(moduleSsspGpioDn.meta.edge));
-#endif
+#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
 #if (AMIROOS_CFG_SSSP_STACK_END != true)
   // UP signal
   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
+#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#if defined(MODULE_INIT_INTERRUPTS)
   // further interrupt signals
   MODULE_INIT_INTERRUPTS();
-#endif
+#endif /* defined(MODULE_INIT_INTERRUPTS) */
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
   /* init shell */
@@ -872,7 +872,7 @@ void aosSysInit(void)
   aosShellAddCommand(&aos.shell, &_shellcmd_shutdown);
 #if (AMIROOS_CFG_TESTS_ENABLE == true)
   aosShellAddCommand(&aos.shell, &_shellcmd_kerneltest);
-#endif
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 #endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
   return;
@@ -898,8 +898,8 @@ inline void aosSysStart(void)
     chVTSetI(&_syssynctimer, chTimeUS2I((t > (AMIROOS_CFG_SSSP_SYSSYNCPERIOD / 2)) ? (t - (AMIROOS_CFG_SSSP_SYSSYNCPERIOD / 2)) : (t + (AMIROOS_CFG_SSSP_SYSSYNCPERIOD / 2))), _sysSyncTimerCallback, NULL);
     chSysUnlock();
   }
-#endif
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   // print system information;
   _printSystemInfo((BaseSequentialStream*)&aos.iostream);
@@ -909,10 +909,10 @@ inline void aosSysStart(void)
   // start system shell thread
 #if (CH_CFG_USE_THREADHIERARCHY == TRUE)
   aos.shell.thread = chThdCreateStatic(_shell_wa, sizeof(_shell_wa), AMIROOS_CFG_SHELL_THREADPRIO, aosShellThread, &aos.shell, &ch.mainthread);
-#else
+#else /* (CH_CFG_USE_THREADHIERARCHY == TRUE) */
   aos.shell.thread = chThdCreateStatic(_shell_wa, sizeof(_shell_wa), AMIROOS_CFG_SHELL_THREADPRIO, aosShellThread, &aos.shell);
-#endif
-#endif
+#endif /* (CH_CFG_USE_THREADHIERARCHY == TRUE) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
   return;
 }
@@ -968,7 +968,7 @@ eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener)
     return m;
   }
 }
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /**
  * @brief   Retrieves the system uptime.
@@ -1018,7 +1018,7 @@ void aosSysSetDateTime(struct tm* dt)
   return;
 }
 
-#endif /* HAL_USE_RTC == TRUE */
+#endif /* (HAL_USE_RTC == TRUE) */
 
 /**
  * @brief   Initializes/Acknowledges a system shutdown/restart request.
@@ -1035,7 +1035,7 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
 #if (AMIROOS_CFG_SSSP_MASTER == true)
   // deactivate the system synchronization timer
   chVTReset(&_syssynctimer);
-#endif
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
 
   // update the system SSSP stage
   aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_1;
@@ -1048,7 +1048,7 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
   // activate the SYS_SYNC signal
   apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_ON);
   chSysUnlock();
-#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   switch (shutdown) {
     case AOS_SHUTDOWN_PASSIVE:
@@ -1080,7 +1080,7 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   // update the system SSSP stage
   aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_2;
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   return;
 }
@@ -1092,7 +1092,7 @@ void aosSysStop(void)
 {
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
   chThdWait(aos.shell.thread);
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
   return;
 }
@@ -1122,7 +1122,7 @@ void aosSysShutdownFinal(aos_shutdown_t shutdown)
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
   // update the system SSSP stage
   aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_3;
-#endif
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   // validate bootloader
   if ((BL_CALLBACK_TABLE_ADDRESS->magicNumber == BL_MAGIC_NUMBER) &&
diff --git a/core/src/aos_unittest.c b/core/src/aos_unittest.c
index 98290a0..849ea1e 100644
--- a/core/src/aos_unittest.c
+++ b/core/src/aos_unittest.c
@@ -293,6 +293,6 @@ void aosUtInfoMsg(BaseSequentialStream* stream, const char* fmt, ...)
   return;
 }
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
diff --git a/modules/DiWheelDrive_1-1/aosconf.h b/modules/DiWheelDrive_1-1/aosconf.h
index c9cf23e..8f34d29 100644
--- a/modules/DiWheelDrive_1-1/aosconf.h
+++ b/modules/DiWheelDrive_1-1/aosconf.h
@@ -42,7 +42,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if defined(AMIRO_APPS) && (AMIRO_APPS == true)
   #include <osconf.h>
-#endif
+#endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */
 
 /*===========================================================================*/
 /**
@@ -56,9 +56,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_DBG)
   #define AMIROOS_CFG_DBG                       true
-#else
+#else /* !defined(OS_CFG_DBG) */
   #define AMIROOS_CFG_DBG                       OS_CFG_DBG
-#endif
+#endif /* !defined(OS_CFG_DBG) */
 
 /**
  * @brief   Flag to enable/disable unit tests.
@@ -66,18 +66,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_TESTS_ENABLE)
   #define AMIROOS_CFG_TESTS_ENABLE              true
-#else
+#else /* !defined(OS_CFG_TESTS_ENABLE) */
   #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
-#endif
+#endif /* !defined(OS_CFG_TESTS_ENABLE) */
 
 /**
  * @brief   Flag to enable/disable profiling API and logic.
  */
 #if !defined(OS_CFG_PROFILE)
   #define AMIROOS_CFG_PROFILE                   true
-#else
+#else /* !defined(OS_CFG_PROFILE) */
   #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
-#endif
+#endif /* !defined(OS_CFG_PROFILE) */
 
 /**
  * @brief   Mask for the control thread to listen to certain IO events.
@@ -85,9 +85,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -95,9 +95,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
 
 /** @} */
 
@@ -113,9 +113,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_ENABLE)
   #define AMIROOS_CFG_SSSP_ENABLE               true
-#else
+#else /* !defined(OS_CFG_SSSP_ENABLE) */
   #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
  * @brief   Flag to set the module as SSSP master.
@@ -123,9 +123,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_MASTER)
   #define AMIROOS_CFG_SSSP_MASTER               false
-#else
+#else /* !defined(OS_CFG_SSSP_MASTER) */
   #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
-#endif
+#endif /* !defined(OS_CFG_SSSP_MASTER) */
 
 /**
  * @brief   Flag to set the module to be the first in the stack.
@@ -133,9 +133,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_START)
   #define AMIROOS_CFG_SSSP_STACK_START          true
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_START) */
   #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_START) */
 
 /**
  * @brief   Flag to set the module to be the last in the stack.
@@ -143,18 +143,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_END)
   #define AMIROOS_CFG_SSSP_STACK_END            false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_END) */
   #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_END) */
 
 /**
  * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
  */
 #if !defined(OS_CFG_SSSP_SIGNALDELAY)
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
-#else
+#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
-#endif
+#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
 
 /**
  * @brief   Time boundary for robot wide clock synchronization in microseconds.
@@ -163,9 +163,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
-#else
+#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
-#endif
+#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
 
 /** @} */
 
@@ -181,18 +181,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_ENABLE)
   #define AMIROOS_CFG_SHELL_ENABLE              true
-#else
+#else /* !defined(OS_CFG_SHELL_ENABLE) */
   #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SHELL_ENABLE) */
 
 /**
  * @brief   Shell thread stack size.
  */
 #if !defined(OS_CFG_SHELL_STACKSIZE)
   #define AMIROOS_CFG_SHELL_STACKSIZE           1024
-#else
+#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
   #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
-#endif
+#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
 
 /**
  * @brief   Shell thread priority.
@@ -213,27 +213,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_THREADPRIO)
   #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
-#else
+#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
   #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
-#endif
+#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
 
 /**
  * @brief   Shell maximum input line length.
  */
 #if !defined(OS_CFG_SHELL_LINEWIDTH)
   #define AMIROOS_CFG_SHELL_LINEWIDTH           64
-#else
+#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
   #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
-#endif
+#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
 
 /**
  * @brief   Shell maximum number of arguments.
  */
 #if !defined(OS_CFG_SHELL_MAXARGS)
   #define AMIROOS_CFG_SHELL_MAXARGS             4
-#else
+#else /* !defined(OS_CFG_SHELL_MAXARGS) */
   #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
-#endif
+#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
 
 /** @} */
 
diff --git a/modules/DiWheelDrive_1-1/module.c b/modules/DiWheelDrive_1-1/module.c
index 94d94a6..d18bcd3 100644
--- a/modules/DiWheelDrive_1-1/module.c
+++ b/modules/DiWheelDrive_1-1/module.c
@@ -82,9 +82,9 @@ PWMConfig moduleHalPwmDriveConfig = {
     },
   },
   /* TIM CR2 register       */ 0,
-#if STM32_PWM_USE_ADVANCED
+#if (STM32_PWM_USE_ADVANCED == TRUE)
   /* TIM BDTR register      */ 0,
-#endif
+#endif /* (STM32_PWM_USE_ADVANCED == TRUE) */
   /* TIM DIER register      */ 0
 };
 
@@ -354,7 +354,7 @@ ROMCONST apalControlGpio_t moduleGpioSysWarmrst = {
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "DiWheelDrive";
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
@@ -806,7 +806,7 @@ aos_unittest_t moduleUtAlldVcnl4020 = {
   /* data           */ &_utVcnl4020Data,
 };
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 /** @} */
diff --git a/modules/DiWheelDrive_1-1/module.h b/modules/DiWheelDrive_1-1/module.h
index 7b4dbbe..c05399a 100644
--- a/modules/DiWheelDrive_1-1/module.h
+++ b/modules/DiWheelDrive_1-1/module.h
@@ -294,7 +294,7 @@ extern ROMCONST apalControlGpio_t moduleGpioSysWarmrst;
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /**
  * @brief   Additional HAL initialization hook.
@@ -337,7 +337,7 @@ extern ROMCONST char* moduleShellPrompt;
 #define MODULE_INIT_TESTS() {                                                 \
   /* add unit-test shell commands */                                          \
   aosShellAddCommand(&aos.shell, &moduleUtAlldA3906.shellcmd);                \
-  aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01b.shellcmd);            \
+  aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01b.shellcmd);             \
   aosShellAddCommand(&aos.shell, &moduleUtAlldHmc5883l.shellcmd);             \
   aosShellAddCommand(&aos.shell, &moduleUtAlldIna219.shellcmd);               \
   aosShellAddCommand(&aos.shell, &moduleUtAlldL3g4200d.shellcmd);             \
@@ -582,7 +582,7 @@ extern aos_unittest_t moduleUtAlldTps62113;
  */
 extern aos_unittest_t moduleUtAlldVcnl4020;
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/LightRing_1-0/aosconf.h b/modules/LightRing_1-0/aosconf.h
index 81c3bfd..b699af1 100644
--- a/modules/LightRing_1-0/aosconf.h
+++ b/modules/LightRing_1-0/aosconf.h
@@ -42,7 +42,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if defined(AMIRO_APPS) && (AMIRO_APPS == true)
   #include <osconf.h>
-#endif
+#endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */
 
 /*===========================================================================*/
 /**
@@ -56,9 +56,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_DBG)
   #define AMIROOS_CFG_DBG                       true
-#else
+#else /* !defined(OS_CFG_DBG) */
   #define AMIROOS_CFG_DBG                       OS_CFG_DBG
-#endif
+#endif /* !defined(OS_CFG_DBG) */
 
 /**
  * @brief   Flag to enable/disable unit tests.
@@ -66,18 +66,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_TESTS_ENABLE)
   #define AMIROOS_CFG_TESTS_ENABLE              true
-#else
+#else /* !defined(OS_CFG_TESTS_ENABLE) */
   #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
-#endif
+#endif /* !defined(OS_CFG_TESTS_ENABLE) */
 
 /**
  * @brief   Flag to enable/disable profiling API and logic.
  */
 #if !defined(OS_CFG_PROFILE)
   #define AMIROOS_CFG_PROFILE                   true
-#else
+#else /* !defined(OS_CFG_PROFILE) */
   #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
-#endif
+#endif /* !defined(OS_CFG_PROFILE) */
 
 /**
  * @brief   Mask for the control thread to listen to certain IO events.
@@ -85,9 +85,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -95,9 +95,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
 
 /** @} */
 
@@ -113,9 +113,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_ENABLE)
   #define AMIROOS_CFG_SSSP_ENABLE               true
-#else
+#else /* !defined(OS_CFG_SSSP_ENABLE) */
   #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
  * @brief   Flag to set the module as SSSP master.
@@ -123,9 +123,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_MASTER)
   #define AMIROOS_CFG_SSSP_MASTER               false
-#else
+#else /* !defined(OS_CFG_SSSP_MASTER) */
   #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
-#endif
+#endif /* !defined(OS_CFG_SSSP_MASTER) */
 
 /**
  * @brief   Flag to set the module to be the first in the stack.
@@ -133,9 +133,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_START)
   #define AMIROOS_CFG_SSSP_STACK_START          false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_START) */
   #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_START) */
 
 /**
  * @brief   Flag to set the module to be the last in the stack.
@@ -143,18 +143,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_END)
   #define AMIROOS_CFG_SSSP_STACK_END            true
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_END) */
   #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_END) */
 
 /**
  * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
  */
 #if !defined(OS_CFG_SSSP_SIGNALDELAY)
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
-#else
+#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
-#endif
+#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
 
 /**
  * @brief   Time boundary for robot wide clock synchronization in microseconds.
@@ -163,9 +163,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
-#else
+#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
-#endif
+#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
 
 /** @} */
 
@@ -181,18 +181,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_ENABLE)
   #define AMIROOS_CFG_SHELL_ENABLE              true
-#else
+#else /* !defined(OS_CFG_SHELL_ENABLE) */
   #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SHELL_ENABLE) */
 
 /**
  * @brief   Shell thread stack size.
  */
 #if !defined(OS_CFG_SHELL_STACKSIZE)
   #define AMIROOS_CFG_SHELL_STACKSIZE           1024
-#else
+#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
   #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
-#endif
+#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
 
 /**
  * @brief   Shell thread priority.
@@ -213,27 +213,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_THREADPRIO)
   #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
-#else
+#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
   #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
-#endif
+#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
 
 /**
  * @brief   Shell maximum input line length.
  */
 #if !defined(OS_CFG_SHELL_LINEWIDTH)
   #define AMIROOS_CFG_SHELL_LINEWIDTH           64
-#else
+#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
   #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
-#endif
+#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
 
 /**
  * @brief   Shell maximum number of arguments.
  */
 #if !defined(OS_CFG_SHELL_MAXARGS)
   #define AMIROOS_CFG_SHELL_MAXARGS             4
-#else
+#else /* !defined(OS_CFG_SHELL_MAXARGS) */
   #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
-#endif
+#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
 
 /** @} */
 
diff --git a/modules/LightRing_1-0/module.c b/modules/LightRing_1-0/module.c
index 7ca204d..94615e9 100644
--- a/modules/LightRing_1-0/module.c
+++ b/modules/LightRing_1-0/module.c
@@ -240,7 +240,7 @@ ROMCONST apalControlGpio_t moduleGpioSysSync = {
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "LightRing";
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
@@ -356,7 +356,7 @@ aos_unittest_t moduleUtAlldTps2051bdbv = {
   /* data           */ &moduleLldPowerSwitchLaser,
 };
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 /** @} */
diff --git a/modules/LightRing_1-0/module.h b/modules/LightRing_1-0/module.h
index 803e0c8..a07a0d1 100644
--- a/modules/LightRing_1-0/module.h
+++ b/modules/LightRing_1-0/module.h
@@ -198,7 +198,7 @@ extern ROMCONST apalControlGpio_t moduleGpioSysSync;
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
@@ -221,7 +221,7 @@ extern ROMCONST char* moduleShellPrompt;
  */
 #define MODULE_INIT_TESTS() {                                                 \
   /* add unit-test shell commands */                                          \
-  aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01b.shellcmd);            \
+  aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01b.shellcmd);             \
   aosShellAddCommand(&aos.shell, &moduleUtAlldTlc5947.shellcmd);              \
   aosShellAddCommand(&aos.shell, &moduleUtAlldTps2051bdbv.shellcmd);          \
 }
@@ -348,7 +348,7 @@ extern aos_unittest_t moduleUtAlldTlc5947;
 extern aos_unittest_t moduleUtAlldTps2051bdbv;
 
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-F103RB/aosconf.h b/modules/NUCLEO-F103RB/aosconf.h
index fd4dbe8..1c5fd88 100644
--- a/modules/NUCLEO-F103RB/aosconf.h
+++ b/modules/NUCLEO-F103RB/aosconf.h
@@ -42,7 +42,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if defined(AMIRO_APPS) && (AMIRO_APPS == true)
   #include <osconf.h>
-#endif
+#endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */
 
 /*===========================================================================*/
 /**
@@ -56,9 +56,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_DBG)
   #define AMIROOS_CFG_DBG                       true
-#else
+#else /* !defined(OS_CFG_DBG) */
   #define AMIROOS_CFG_DBG                       OS_CFG_DBG
-#endif
+#endif /* !defined(OS_CFG_DBG) */
 
 /**
  * @brief   Flag to enable/disable unit tests.
@@ -66,18 +66,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_TESTS_ENABLE)
   #define AMIROOS_CFG_TESTS_ENABLE              true
-#else
+#else /* !defined(OS_CFG_TESTS_ENABLE) */
   #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
-#endif
+#endif /* !defined(OS_CFG_TESTS_ENABLE) */
 
 /**
  * @brief   Flag to enable/disable profiling API and logic.
  */
 #if !defined(OS_CFG_PROFILE)
   #define AMIROOS_CFG_PROFILE                   true
-#else
+#else /* !defined(OS_CFG_PROFILE) */
   #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
-#endif
+#endif /* !defined(OS_CFG_PROFILE) */
 
 /**
  * @brief   Mask for the control thread to listen to certain IO events.
@@ -85,9 +85,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    (MODULE_OS_IOEVENTFLAGS_DW1000_IRQn | MODULE_OS_IOEVENTFLAGS_USERBUTTON)
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -95,9 +95,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
 
 /** @} */
 
@@ -113,9 +113,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_ENABLE)
   #define AMIROOS_CFG_SSSP_ENABLE               false
-#else
+#else /* !defined(OS_CFG_SSSP_ENABLE) */
   #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
  * @brief   Flag to set the module as SSSP master.
@@ -123,9 +123,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_MASTER)
   #define AMIROOS_CFG_SSSP_MASTER               false
-#else
+#else /* !defined(OS_CFG_SSSP_MASTER) */
   #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
-#endif
+#endif /* !defined(OS_CFG_SSSP_MASTER) */
 
 /**
  * @brief   Flag to set the module to be the first in the stack.
@@ -133,9 +133,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_START)
   #define AMIROOS_CFG_SSSP_STACK_START          false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_START) */
   #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_START) */
 
 /**
  * @brief   Flag to set the module to be the last in the stack.
@@ -143,18 +143,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_END)
   #define AMIROOS_CFG_SSSP_STACK_END            false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_END) */
   #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_END) */
 
 /**
  * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
  */
 #if !defined(OS_CFG_SSSP_SIGNALDELAY)
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
-#else
+#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
-#endif
+#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
 
 /**
  * @brief   Time boundary for robot wide clock synchronization in microseconds.
@@ -163,9 +163,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
-#else
+#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
-#endif
+#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
 
 /** @} */
 
@@ -181,18 +181,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_ENABLE)
   #define AMIROOS_CFG_SHELL_ENABLE              true
-#else
+#else /* !defined(OS_CFG_SHELL_ENABLE) */
   #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SHELL_ENABLE) */
 
 /**
  * @brief   Shell thread stack size.
  */
 #if !defined(OS_CFG_SHELL_STACKSIZE)
   #define AMIROOS_CFG_SHELL_STACKSIZE           1024
-#else
+#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
   #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
-#endif
+#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
 
 /**
  * @brief   Shell thread priority.
@@ -213,27 +213,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_THREADPRIO)
   #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
-#else
+#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
   #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
-#endif
+#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
 
 /**
  * @brief   Shell maximum input line length.
  */
 #if !defined(OS_CFG_SHELL_LINEWIDTH)
   #define AMIROOS_CFG_SHELL_LINEWIDTH           64
-#else
+#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
   #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
-#endif
+#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
 
 /**
  * @brief   Shell maximum number of arguments.
  */
 #if !defined(OS_CFG_SHELL_MAXARGS)
   #define AMIROOS_CFG_SHELL_MAXARGS             4
-#else
+#else /* !defined(OS_CFG_SHELL_MAXARGS) */
   #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
-#endif
+#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-F103RB/module.c b/modules/NUCLEO-F103RB/module.c
index c9792df..54c4129 100644
--- a/modules/NUCLEO-F103RB/module.c
+++ b/modules/NUCLEO-F103RB/module.c
@@ -49,7 +49,7 @@ SerialConfig moduleHalProgIfConfig = {
   /* CR1      */ 0,
 };
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 
 /*! SPI (high and low speed) configuration for DW1000 */
 SPIConfig moduleHalSpiUwbHsConfig = {
@@ -70,7 +70,7 @@ SPIConfig moduleHalSpiUwbLsConfig = {
   /* CR2                         */ 0,
 };
 
-#endif
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 /** @} */
 
@@ -97,7 +97,7 @@ ROMCONST apalControlGpio_t moduleGpioLed = {
   },
 };
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 
 /**
  * @brief   DW1000 reset output signal GPIO.
@@ -149,7 +149,7 @@ ROMCONST apalControlGpio_t moduleGpioSpiChipSelect = {
   },
 };
 
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 /**
  * @brief   User button input signal GPIO.
@@ -178,7 +178,7 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "NUCLEO-F103RB";
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
@@ -197,7 +197,7 @@ ROMCONST char* moduleShellPrompt = "NUCLEO-F103RB";
  */
 /*===========================================================================*/
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 
 /*! @brief TODO: Manual implementation of SPI configuration. Somehow, it is necessary in NUCLEO-F103RB  */
 void dw1000_spi_init(void){
@@ -208,7 +208,7 @@ void dw1000_spi_init(void){
   apalGpioWrite(moduleGpioSpiChipSelect.gpio, APAL_GPIO_LOW);
 }
 
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 /** @} */
 
 /*===========================================================================*/
@@ -218,7 +218,7 @@ void dw1000_spi_init(void){
  */
 /*===========================================================================*/
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 
 DW1000Driver moduleLldDw1000 = {
   /* SPI driver         */ &MODULE_HAL_SPI_UWB,
@@ -226,7 +226,7 @@ DW1000Driver moduleLldDw1000 = {
   /* RESET DW1000       */ &moduleGpioDw1000Reset,
 };
 
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 /** @} */
 
 /*===========================================================================*/
@@ -237,7 +237,7 @@ DW1000Driver moduleLldDw1000 = {
 /*===========================================================================*/
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 
 /*
  * UwB Driver (DW1000)
@@ -260,9 +260,9 @@ aos_unittest_t moduleUtAlldDw1000 = {
   },
   /* data           */ &moduleLldDw1000,
 };
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 /** @} */
diff --git a/modules/NUCLEO-F103RB/module.h b/modules/NUCLEO-F103RB/module.h
index 7a5bdf8..15cb346 100644
--- a/modules/NUCLEO-F103RB/module.h
+++ b/modules/NUCLEO-F103RB/module.h
@@ -36,19 +36,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /*===========================================================================*/
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
 
 void dw1000_spi_init(void);
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 
 /** @} */
@@ -76,7 +76,7 @@ extern SerialConfig moduleHalProgIfConfig;
 #define MODULE_HAL_RTC                          RTCD1
 
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 
 /**
  * @brief   SPI interface driver for the motion sensors (gyroscope and accelerometer).
@@ -94,7 +94,7 @@ extern SPIConfig moduleHalSpiUwbHsConfig;
  */
 extern SPIConfig moduleHalSpiUwbLsConfig;
 
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 /** @} */
 
@@ -111,7 +111,7 @@ extern SPIConfig moduleHalSpiUwbLsConfig;
  */
 extern ROMCONST apalControlGpio_t moduleGpioLed;
 
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 /**
  * @brief   DW1000 reset output signal
  * @note    the reset pin should be drived as low by MCU to activate.
@@ -130,7 +130,7 @@ extern ROMCONST apalControlGpio_t moduleGpioDw1000Irqn;
  */
 extern ROMCONST apalControlGpio_t moduleGpioSpiChipSelect ;
 
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 /**
  * @brief   User button input signal.
@@ -162,7 +162,7 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 
 /**
@@ -175,15 +175,15 @@ extern ROMCONST char* moduleShellPrompt;
   palEnablePadEvent(moduleGpioUserButton.gpio->port, moduleGpioUserButton.gpio->pad, APAL2CH_EDGE(moduleGpioUserButton.meta.edge));   \
   MODULE_INIT_INTERRUPTS_DW1000();                                            \
 }
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
   #define MODULE_INIT_INTERRUPTS_DW1000() {                                   \
     palSetPadCallback(moduleGpioDw1000Irqn.gpio->port, moduleGpioDw1000Irqn.gpio->pad, _intCallback, &moduleGpioDw1000Irqn.gpio->pad);  \
     palEnablePadEvent(moduleGpioDw1000Irqn.gpio->port, moduleGpioDw1000Irqn.gpio->pad, APAL2CH_EDGE(moduleGpioDw1000Irqn.meta.edge));   \
   }
-#else
-  #define MODULE_INIT_INTERRUPTS_DW1000() {                                  \
+#else /* defined(AMIROLLD_CFG_DW1000) */
+  #define MODULE_INIT_INTERRUPTS_DW1000() {                                   \
   }
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 
 /**
@@ -193,14 +193,14 @@ extern ROMCONST char* moduleShellPrompt;
   /* add unit-test shell commands */                                          \
   MODULE_INIT_TESTS_DW1000();                                                 \
 }
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
   #define MODULE_INIT_TESTS_DW1000() {                                        \
     aosShellAddCommand(&aos.shell, &moduleUtAlldDw1000.shellcmd);             \
   }
-#else
-  #define MODULE_INIT_TESTS_DW1000() {                                         \
+#else /* defined(AMIROLLD_CFG_DW1000) */
+  #define MODULE_INIT_TESTS_DW1000() {                                        \
   }
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 
 /**
@@ -211,16 +211,16 @@ extern ROMCONST char* moduleShellPrompt;
   sdStart(&MODULE_HAL_PROGIF, &moduleHalProgIfConfig);                        \
   MODULE_INIT_PERIPHERY_COMM_DW1000();                                        \
 }
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
   #define MODULE_INIT_PERIPHERY_COMM_DW1000() {                               \
     /* SPI init */                                                            \
     dw1000_spi_init();                                                        \
     spiStart(&MODULE_HAL_SPI_UWB, &moduleHalSpiUwbLsConfig);                  \
   }
-#else
+#else /* defined(AMIROLLD_CFG_DW1000) */
   #define MODULE_INIT_PERIPHERY_COMM_DW1000() {                               \
   }
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 
 /**
@@ -229,20 +229,20 @@ extern ROMCONST char* moduleShellPrompt;
 #define MODULE_SHUTDOWN_PERIPHERY_COMM() {                                    \
   MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000();                                    \
 }
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 #define MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000() {                             \
   /* SPI */                                                                   \
   spiStop(&MODULE_HAL_SPI_UWB);                                               \
 }
-#else
+#else /* defined(AMIROLLD_CFG_DW1000) */
   #define MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000() {                           \
   }
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 /**
  * @brief   HOOK to call process_deca_irq() func when the dw1000 interrupt pin is activated.
  */
-#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {		                          \
+#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {	                              \
   if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) {                       \
     apalControlGpioState_t buttonstate;                                       \
     apalControlGpioGet(&moduleGpioUserButton, &buttonstate);                  \
@@ -250,17 +250,17 @@ extern ROMCONST char* moduleShellPrompt;
   }                                                                           \
   MODULE_MAIN_LOOP_IO_EVENT_DW1000();                                         \
 }
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
   #define MODULE_MAIN_LOOP_IO_EVENT_DW1000() {                                \
-    if(eventflags & MODULE_OS_IOEVENTFLAGS_DW1000_IRQn) {		              \
+    if(eventflags & MODULE_OS_IOEVENTFLAGS_DW1000_IRQn) {                     \
       /*apalGpioToggle(moduleGpioLedGreen.gpio); // just for debug  */        \
       process_deca_irq();                                                     \
-    }	                                                                      \
+    }                                                                         \
   }
-#else
+#else /* defined(AMIROLLD_CFG_DW1000) */
   #define MODULE_MAIN_LOOP_IO_EVENT_DW1000() {                                \
   }
-#endif  /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 /** @} */
 
@@ -279,12 +279,12 @@ extern ROMCONST char* moduleShellPrompt;
  * @{
  */
 /*===========================================================================*/
-#ifdef AMIROLLD_CFG_DW1000
+#if defined(AMIROLLD_CFG_DW1000)
 #include <alld_DW1000.h>
 
 extern DW1000Driver moduleLldDw1000;
 
-#endif /* AMIROLLD_CFG_DW1000 */
+#endif /* defined(AMIROLLD_CFG_DW1000) */
 
 /** @} */
 
@@ -297,7 +297,7 @@ extern DW1000Driver moduleLldDw1000;
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
 #if defined(AMIROLLD_CFG_DW1000) && (AMIROLLD_CFG_DW1000 == 1)
-#include<ut_alld_dw1000_v1.h>
+#include <ut_alld_dw1000_v1.h>
 
 /**
  * @brief   DW1000 unit test object.
@@ -306,7 +306,7 @@ extern aos_unittest_t moduleUtAlldDw1000;
 
 #endif /* defined(AMIROLLD_CFG_DW1000) && (AMIROLLD_CFG_DW1000 == 1) */
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-L476RG/aosconf.h b/modules/NUCLEO-L476RG/aosconf.h
index a905f8a..c463999 100644
--- a/modules/NUCLEO-L476RG/aosconf.h
+++ b/modules/NUCLEO-L476RG/aosconf.h
@@ -42,7 +42,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if defined(AMIRO_APPS) && (AMIRO_APPS == true)
   #include <osconf.h>
-#endif
+#endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */
 
 /*===========================================================================*/
 /**
@@ -56,9 +56,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_DBG)
   #define AMIROOS_CFG_DBG                       true
-#else
+#else /* !defined(OS_CFG_DBG) */
   #define AMIROOS_CFG_DBG                       OS_CFG_DBG
-#endif
+#endif /* !defined(OS_CFG_DBG) */
 
 /**
  * @brief   Flag to enable/disable unit tests.
@@ -66,18 +66,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_TESTS_ENABLE)
   #define AMIROOS_CFG_TESTS_ENABLE              true
-#else
+#else /* !defined(OS_CFG_TESTS_ENABLE) */
   #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
-#endif
+#endif /* !defined(OS_CFG_TESTS_ENABLE) */
 
 /**
  * @brief   Flag to enable/disable profiling API and logic.
  */
 #if !defined(OS_CFG_PROFILE)
   #define AMIROOS_CFG_PROFILE                   true
-#else
+#else /* !defined(OS_CFG_PROFILE) */
   #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
-#endif
+#endif /* !defined(OS_CFG_PROFILE) */
 
 /**
  * @brief   Mask for the control thread to listen to certain IO events.
@@ -85,9 +85,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    MODULE_OS_IOEVENTFLAGS_USERBUTTON
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -95,9 +95,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
 
 /** @} */
 
@@ -113,9 +113,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_ENABLE)
   #define AMIROOS_CFG_SSSP_ENABLE               false
-#else
+#else /* !defined(OS_CFG_SSSP_ENABLE) */
   #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
  * @brief   Flag to set the module as SSSP master.
@@ -123,9 +123,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_MASTER)
   #define AMIROOS_CFG_SSSP_MASTER               false
-#else
+#else /* !defined(OS_CFG_SSSP_MASTER) */
   #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
-#endif
+#endif /* !defined(OS_CFG_SSSP_MASTER) */
 
 /**
  * @brief   Flag to set the module to be the first in the stack.
@@ -133,9 +133,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_START)
   #define AMIROOS_CFG_SSSP_STACK_START          false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_START) */
   #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_START) */
 
 /**
  * @brief   Flag to set the module to be the last in the stack.
@@ -143,18 +143,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_END)
   #define AMIROOS_CFG_SSSP_STACK_END            false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_END) */
   #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_END) */
 
 /**
  * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
  */
 #if !defined(OS_CFG_SSSP_SIGNALDELAY)
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
-#else
+#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
-#endif
+#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
 
 /**
  * @brief   Time boundary for robot wide clock synchronization in microseconds.
@@ -163,9 +163,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
-#else
+#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
-#endif
+#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
 
 /** @} */
 
@@ -181,18 +181,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_ENABLE)
   #define AMIROOS_CFG_SHELL_ENABLE              true
-#else
+#else /* !defined(OS_CFG_SHELL_ENABLE) */
   #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SHELL_ENABLE) */
 
 /**
  * @brief   Shell thread stack size.
  */
 #if !defined(OS_CFG_SHELL_STACKSIZE)
   #define AMIROOS_CFG_SHELL_STACKSIZE           1024
-#else
+#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
   #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
-#endif
+#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
 
 /**
  * @brief   Shell thread priority.
@@ -213,27 +213,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_THREADPRIO)
   #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
-#else
+#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
   #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
-#endif
+#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
 
 /**
  * @brief   Shell maximum input line length.
  */
 #if !defined(OS_CFG_SHELL_LINEWIDTH)
   #define AMIROOS_CFG_SHELL_LINEWIDTH           64
-#else
+#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
   #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
-#endif
+#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
 
 /**
  * @brief   Shell maximum number of arguments.
  */
 #if !defined(OS_CFG_SHELL_MAXARGS)
   #define AMIROOS_CFG_SHELL_MAXARGS             4
-#else
+#else /* !defined(OS_CFG_SHELL_MAXARGS) */
   #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
-#endif
+#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-L476RG/module.c b/modules/NUCLEO-L476RG/module.c
index 307162b..611a0e7 100644
--- a/modules/NUCLEO-L476RG/module.c
+++ b/modules/NUCLEO-L476RG/module.c
@@ -111,7 +111,7 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "NUCLEO-L476RG";
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
@@ -178,7 +178,7 @@ aos_unittest_t moduleUtAlldMpu6050 = {
 
 #endif /* defined(AMIROLLD_CFG_MPU6050) */
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 /** @} */
diff --git a/modules/NUCLEO-L476RG/module.h b/modules/NUCLEO-L476RG/module.h
index c41aea4..3591958 100644
--- a/modules/NUCLEO-L476RG/module.h
+++ b/modules/NUCLEO-L476RG/module.h
@@ -113,7 +113,7 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
@@ -137,9 +137,9 @@ extern ROMCONST char* moduleShellPrompt;
     /* add unit-test shell commands */                                        \
     aosShellAddCommand(&aos.shell, &moduleUtAlldMpu6050.shellcmd);            \
   }
-#else
+#else /* defined(AMIROLLD_CFG_MPU6050) */
   #define MODULE_INIT_TEST_MPU6050() {}
-#endif
+#endif /* defined(AMIROLLD_CFG_MPU6050) */
 
 /**
  * @brief   Periphery communication interfaces initialization hook.
@@ -175,9 +175,9 @@ extern ROMCONST char* moduleShellPrompt;
     chSysUnlock();                                                            \
     i2cStart(&MODULE_HAL_I2C3, &moduleHalI2c3Config);                         \
   }
-#else
+#else /* defined(AMIROLLD_CFG_MPU6050) */
   #define MODULE_INIT_PERIPHERY_COMM_MPU6050() {}
-#endif
+#endif /* defined(AMIROLLD_CFG_MPU6050) */
 
 /**
  * @brief   Periphery communication interface deinitialization hook.
@@ -246,7 +246,7 @@ extern aos_unittest_t moduleUtAlldMpu6050;
 
 #endif /* defined(AMIROLLD_CFG_MPU6050) */
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/PowerManagement_1-1/alldconf.h b/modules/PowerManagement_1-1/alldconf.h
index 7f4dbb3..832924f 100644
--- a/modules/PowerManagement_1-1/alldconf.h
+++ b/modules/PowerManagement_1-1/alldconf.h
@@ -106,7 +106,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define AMIROLLD_CFG_VCNL4020                   1
 
-#endif /* BOARD_SENSORRING == BOARD_PROXIMITYSENSOR */
+#endif /* (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) || defined(__DOXYGEN__)
 
@@ -120,7 +120,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define AMIROLLD_CFG_AT42QT1050                 1
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
 
@@ -134,7 +134,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define AMIROLLD_CFG_AT42QT1050                 1
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) */
 
 #endif /* ALLDCONF_H */
 
diff --git a/modules/PowerManagement_1-1/aosconf.h b/modules/PowerManagement_1-1/aosconf.h
index 5a529db..3ab5742 100644
--- a/modules/PowerManagement_1-1/aosconf.h
+++ b/modules/PowerManagement_1-1/aosconf.h
@@ -42,7 +42,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if defined(AMIRO_APPS) && (AMIRO_APPS == true)
   #include <osconf.h>
-#endif
+#endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */
 
 /*===========================================================================*/
 /**
@@ -56,9 +56,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_DBG)
   #define AMIROOS_CFG_DBG                       true
-#else
+#else /* !defined(OS_CFG_DBG) */
   #define AMIROOS_CFG_DBG                       OS_CFG_DBG
-#endif
+#endif /* !defined(OS_CFG_DBG) */
 
 /**
  * @brief   Flag to enable/disable unit tests.
@@ -66,18 +66,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_TESTS_ENABLE)
   #define AMIROOS_CFG_TESTS_ENABLE              true
-#else
+#else /* !defined(OS_CFG_TESTS_ENABLE) */
   #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
-#endif
+#endif /* !defined(OS_CFG_TESTS_ENABLE) */
 
 /**
  * @brief   Flag to enable/disable profiling API and logic.
  */
 #if !defined(OS_CFG_PROFILE)
   #define AMIROOS_CFG_PROFILE                   true
-#else
+#else /* !defined(OS_CFG_PROFILE) */
   #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
-#endif
+#endif /* !defined(OS_CFG_PROFILE) */
 
 /**
  * @brief   Mask for the control thread to listen to certain IO events.
@@ -85,9 +85,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -95,9 +95,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
 
 /** @} */
 
@@ -113,9 +113,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_ENABLE)
   #define AMIROOS_CFG_SSSP_ENABLE               true
-#else
+#else /* !defined(OS_CFG_SSSP_ENABLE) */
   #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
  * @brief   Flag to set the module as SSSP master.
@@ -123,9 +123,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_MASTER)
   #define AMIROOS_CFG_SSSP_MASTER               true
-#else
+#else /* !defined(OS_CFG_SSSP_MASTER) */
   #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
-#endif
+#endif /* !defined(OS_CFG_SSSP_MASTER) */
 
 /**
  * @brief   Flag to set the module to be the first in the stack.
@@ -133,9 +133,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_START)
   #define AMIROOS_CFG_SSSP_STACK_START          false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_START) */
   #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_START) */
 
 /**
  * @brief   Flag to set the module to be the last in the stack.
@@ -143,18 +143,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_END)
   #define AMIROOS_CFG_SSSP_STACK_END            false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_END) */
   #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_END) */
 
 /**
  * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
  */
 #if !defined(OS_CFG_SSSP_SIGNALDELAY)
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
-#else
+#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
-#endif
+#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
 
 /**
  * @brief   Time boundary for robot wide clock synchronization in microseconds.
@@ -163,9 +163,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
-#else
+#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
-#endif
+#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
 
 /** @} */
 
@@ -181,18 +181,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_ENABLE)
   #define AMIROOS_CFG_SHELL_ENABLE              true
-#else
+#else /* !defined(OS_CFG_SHELL_ENABLE) */
   #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SHELL_ENABLE) */
 
 /**
  * @brief   Shell thread stack size.
  */
 #if !defined(OS_CFG_SHELL_STACKSIZE)
   #define AMIROOS_CFG_SHELL_STACKSIZE           1024
-#else
+#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
   #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
-#endif
+#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
 
 /**
  * @brief   Shell thread priority.
@@ -213,27 +213,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_THREADPRIO)
   #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
-#else
+#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
   #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
-#endif
+#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
 
 /**
  * @brief   Shell maximum input line length.
  */
 #if !defined(OS_CFG_SHELL_LINEWIDTH)
   #define AMIROOS_CFG_SHELL_LINEWIDTH           64
-#else
+#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
   #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
-#endif
+#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
 
 /**
  * @brief   Shell maximum number of arguments.
  */
 #if !defined(OS_CFG_SHELL_MAXARGS)
   #define AMIROOS_CFG_SHELL_MAXARGS             4
-#else
+#else /* !defined(OS_CFG_SHELL_MAXARGS) */
   #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
-#endif
+#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
 
 /** @} */
 
diff --git a/modules/PowerManagement_1-1/module.c b/modules/PowerManagement_1-1/module.c
index 1fea575..ee319ff 100644
--- a/modules/PowerManagement_1-1/module.c
+++ b/modules/PowerManagement_1-1/module.c
@@ -98,9 +98,9 @@ PWMConfig moduleHalPwmBuzzerConfig = {
     },
   },
   /* TIM CR2 register       */ 0,
-#if STM32_PWM_USE_ADVANCED
+#if (STM32_PWM_USE_ADVANCED == TRUE)
   /* TIM BDTR register      */ 0,
-#endif
+#endif /* (STM32_PWM_USE_ADVANCED == TRUE) */
   /* TIM DIER register      */ 0,
 };
 
@@ -156,10 +156,10 @@ ROMCONST apalControlGpio_t moduleGpioIrInt1 = {
 #elif (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X)
     /* active state   */ (PCAL6524_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
     /* interrupt edge */ PCAL6524_LLD_INT_EDGE,
-#else
+#else /* (BOARD_SENSORRING == ?) */
     /* active state   */ APAL_GPIO_ACTIVE_LOW,
     /* interrupt edge */ APAL_GPIO_EDGE_NONE,
-#endif
+#endif /* (BOARD_SENSORRING == ?) */
   },
 };
 
@@ -359,10 +359,10 @@ ROMCONST apalControlGpio_t moduleGpioIrInt2 = {
 #elif (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X)
     /* active state   */ (PCAL6524_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
     /* interrupt edge */ PCAL6524_LLD_INT_EDGE,
-#else
+#else /* (BOARD_SENSORRING == ?) */
     /* active state   */ APAL_GPIO_ACTIVE_LOW,
     /* interrupt edge */ APAL_GPIO_EDGE_NONE,
-#endif
+#endif /* (BOARD_SENSORRING == ?) */
   },
 };
 
@@ -386,10 +386,10 @@ ROMCONST apalControlGpio_t moduleGpioTouchInt = {
 #elif (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X)
     /* active state   */ (AT42QT1050_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
     /* interrupt edge */ AT42QT1050_LLD_INT_EDGE,
-#else
+#else /* (BOARD_SENSORRING == ?) */
     /* active state   */ APAL_GPIO_ACTIVE_LOW,
     /* interrupt edge */ APAL_GPIO_EDGE_NONE,
-#endif
+#endif /* (BOARD_SENSORRING == ?) */
   },
 };
 
@@ -548,7 +548,7 @@ ROMCONST apalControlGpio_t moduleGpioChargeEn2 = {
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "PowerManagement";
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
@@ -662,7 +662,7 @@ VCNL4020Driver moduleLldProximity2 = {
   /* I²C Driver */ &MODULE_HAL_I2C_SR_PM42_PM50_PMVDD_EEPROM_GAUGEFRONT,
 };
 
-#endif /* BOARD_SENSORRING == BOARD_PROXIMITYSENSOR */
+#endif /* (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) || defined(__DOXYGEN__)
 
@@ -681,7 +681,7 @@ AT42QT1050Driver moduleLldTouch = {
   /* I²C address  */ AT42QT1050_LLD_I2C_ADDRSEL_LOW,
 };
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
 
@@ -700,7 +700,7 @@ AT42QT1050Driver moduleLldTouch = {
   /* I²C address  */ AT42QT1050_LLD_I2C_ADDRSEL_LOW,
 };
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) */
 
 /** @} */
 
@@ -1315,7 +1315,7 @@ aos_unittest_t moduleUtAlldVcnl4020 = {
   /* data           */ &_utAlldVcnl4020Data,
 };
 
-#endif /* BOARD_SENSORRING == BOARD_PROXIMITYSENSOR */
+#endif /* (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) || defined(__DOXYGEN__)
 
@@ -1392,7 +1392,7 @@ aos_unittest_t moduleUtAlldAt42qt1050 = {
   /* data           */ &_utAlldAt42qt1050Data,
 };
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
 
@@ -1469,9 +1469,9 @@ aos_unittest_t moduleUtAlldAt42qt1050 = {
   /* data           */ &_utAlldAt42qt1050Data,
 };
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) */
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 /** @} */
diff --git a/modules/PowerManagement_1-1/module.h b/modules/PowerManagement_1-1/module.h
index dc36183..5474fdc 100644
--- a/modules/PowerManagement_1-1/module.h
+++ b/modules/PowerManagement_1-1/module.h
@@ -389,7 +389,7 @@ extern ROMCONST apalControlGpio_t moduleGpioChargeEn2;
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
@@ -461,9 +461,9 @@ extern ROMCONST char* moduleShellPrompt;
     aosShellAddCommand(&aos.shell, &moduleUtAlldPcal6524.shellcmd);           \
     aosShellAddCommand(&aos.shell, &moduleUtAlldAt42qt1050.shellcmd);         \
   }
-#else
+#else /* (BOARD_SENSORRING == ?) */
   #define MODULE_INIT_TEST_SENSORRING()         {}
-#endif
+#endif /* (BOARD_SENSORRING == ?) */
 
 /**
  * @brief   Periphery communication interfaces initialization hook.
@@ -511,9 +511,9 @@ extern ROMCONST char* moduleShellPrompt;
     moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed = (PCAL6524_LLD_I2C_MAXFREQUENCY < moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed) ? PCAL6524_LLD_I2C_MAXFREQUENCY : moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed;  \
     moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed = (AT42QT1050_LLD_I2C_MAXFREQUENCY < moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed) ? AT42QT1050_LLD_I2C_MAXFREQUENCY : moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed;  \
   }
-#else
+#else /* (BOARD_SENSORRING == ?) */
   #define MODULE_INIT_PERIPHERY_COMM_SENSORRING() {}
-#endif
+#endif /* (BOARD_SENSORRING == ?) */
 
 /**
  * @brief   Periphery communication interface deinitialization hook.
@@ -686,7 +686,7 @@ extern VCNL4020Driver moduleLldProximity1;
  */
 extern VCNL4020Driver moduleLldProximity2;
 
-#endif /* BOARD_SENSORRING == BOARD_PROXIMITYSENSOR */
+#endif /* (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) || defined(__DOXYGEN__)
 
@@ -708,7 +708,7 @@ extern PCAL6524Driver moduleLldGpioExtender2;
  */
 extern AT42QT1050Driver moduleLldTouch;
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
 
@@ -730,7 +730,7 @@ extern PCAL6524Driver moduleLldGpioExtender2;
  */
 extern AT42QT1050Driver moduleLldTouch;
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) */
 
 /** @} */
 
@@ -823,7 +823,7 @@ extern aos_unittest_t moduleUtAlldPca9544a;
  */
 extern aos_unittest_t moduleUtAlldVcnl4020;
 
-#endif /* BOARD_SENSORRING == BOARD_PROXIMITYSENSOR */
+#endif /* (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) || defined(__DOXYGEN__)
 
@@ -840,7 +840,7 @@ extern aos_unittest_t moduleUtAlldPcal6524;
  */
 extern aos_unittest_t moduleUtAlldAt42qt1050;
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
 
@@ -857,9 +857,9 @@ extern aos_unittest_t moduleUtAlldPcal6524;
  */
 extern aos_unittest_t moduleUtAlldAt42qt1050;
 
-#endif /* BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X */
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) */
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/STM32F407G-DISC1/aosconf.h b/modules/STM32F407G-DISC1/aosconf.h
index a61adfe..f2ab8d2 100644
--- a/modules/STM32F407G-DISC1/aosconf.h
+++ b/modules/STM32F407G-DISC1/aosconf.h
@@ -42,7 +42,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if defined(AMIRO_APPS) && (AMIRO_APPS == true)
   #include <osconf.h>
-#endif
+#endif /* defined(AMIRO_APPS) && (AMIRO_APPS == true) */
 
 /*===========================================================================*/
 /**
@@ -56,9 +56,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_DBG)
   #define AMIROOS_CFG_DBG                       true
-#else
+#else /* !defined(OS_CFG_DBG) */
   #define AMIROOS_CFG_DBG                       OS_CFG_DBG
-#endif
+#endif /* !defined(OS_CFG_DBG) */
 
 /**
  * @brief   Flag to enable/disable unit tests.
@@ -66,18 +66,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_TESTS_ENABLE)
   #define AMIROOS_CFG_TESTS_ENABLE              true
-#else
+#else /* !defined(OS_CFG_TESTS_ENABLE) */
   #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
-#endif
+#endif /* !defined(OS_CFG_TESTS_ENABLE) */
 
 /**
  * @brief   Flag to enable/disable profiling API and logic.
  */
 #if !defined(OS_CFG_PROFILE)
   #define AMIROOS_CFG_PROFILE                   true
-#else
+#else /* !defined(OS_CFG_PROFILE) */
   #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
-#endif
+#endif /* !defined(OS_CFG_PROFILE) */
 
 /**
  * @brief   Mask for the control thread to listen to certain IO events.
@@ -85,9 +85,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    MODULE_OS_IOEVENTFLAGS_USERBUTTON
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
   #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -95,9 +95,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         0
-#else
+#else /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
   #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
-#endif
+#endif /* !defined(OS_CFG_MAIN_LOOP_TIMEOUT) */
 
 /** @} */
 
@@ -113,9 +113,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_ENABLE)
   #define AMIROOS_CFG_SSSP_ENABLE               false
-#else
+#else /* !defined(OS_CFG_SSSP_ENABLE) */
   #define AMIROOS_CFG_SSSP_ENABLE               OS_CFG_SSSP_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
  * @brief   Flag to set the module as SSSP master.
@@ -123,9 +123,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_MASTER)
   #define AMIROOS_CFG_SSSP_MASTER               false
-#else
+#else /* !defined(OS_CFG_SSSP_MASTER) */
   #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
-#endif
+#endif /* !defined(OS_CFG_SSSP_MASTER) */
 
 /**
  * @brief   Flag to set the module to be the first in the stack.
@@ -133,9 +133,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_START)
   #define AMIROOS_CFG_SSSP_STACK_START          false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_START) */
   #define AMIROOS_CFG_SSSP_STACK_START          OS_CFG_SSSP_STACK_START
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_START) */
 
 /**
  * @brief   Flag to set the module to be the last in the stack.
@@ -143,18 +143,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_STACK_END)
   #define AMIROOS_CFG_SSSP_STACK_END            false
-#else
+#else /* !defined(OS_CFG_SSSP_STACK_END) */
   #define AMIROOS_CFG_SSSP_STACK_END            OS_CFG_SSSP_STACK_END
-#endif
+#endif /* !defined(OS_CFG_SSSP_STACK_END) */
 
 /**
  * @brief   Delay time (in microseconds) how long a SSSP signal must be active.
  */
 #if !defined(OS_CFG_SSSP_SIGNALDELAY)
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          1000
-#else
+#else /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
   #define AMIROOS_CFG_SSSP_SIGNALDELAY          OS_CFG_SSSP_SIGNALDELAY
-#endif
+#endif /* !defined(OS_CFG_SSSP_SIGNALDELAY) */
 
 /**
  * @brief   Time boundary for robot wide clock synchronization in microseconds.
@@ -163,9 +163,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
-#else
+#else /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
   #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
-#endif
+#endif /* !defined(OS_CFG_SSSP_SYSSYNCPERIOD) */
 
 /** @} */
 
@@ -181,18 +181,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_ENABLE)
   #define AMIROOS_CFG_SHELL_ENABLE              true
-#else
+#else /* !defined(OS_CFG_SHELL_ENABLE) */
   #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
-#endif
+#endif /* !defined(OS_CFG_SHELL_ENABLE) */
 
 /**
  * @brief   Shell thread stack size.
  */
 #if !defined(OS_CFG_SHELL_STACKSIZE)
   #define AMIROOS_CFG_SHELL_STACKSIZE           1024
-#else
+#else /* !defined(OS_CFG_SHELL_STACKSIZE) */
   #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
-#endif
+#endif /* !defined(OS_CFG_SHELL_STACKSIZE) */
 
 /**
  * @brief   Shell thread priority.
@@ -213,27 +213,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #if !defined(OS_CFG_SHELL_THREADPRIO)
   #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
-#else
+#else /* !defined(OS_CFG_SHELL_THREADPRIO) */
   #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
-#endif
+#endif /* !defined(OS_CFG_SHELL_THREADPRIO) */
 
 /**
  * @brief   Shell maximum input line length.
  */
 #if !defined(OS_CFG_SHELL_LINEWIDTH)
   #define AMIROOS_CFG_SHELL_LINEWIDTH           64
-#else
+#else /* !defined(OS_CFG_SHELL_LINEWIDTH) */
   #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
-#endif
+#endif /* !defined(OS_CFG_SHELL_LINEWIDTH) */
 
 /**
  * @brief   Shell maximum number of arguments.
  */
 #if !defined(OS_CFG_SHELL_MAXARGS)
   #define AMIROOS_CFG_SHELL_MAXARGS             4
-#else
+#else /* !defined(OS_CFG_SHELL_MAXARGS) */
   #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
-#endif
+#endif /* !defined(OS_CFG_SHELL_MAXARGS) */
 
 /** @} */
 
diff --git a/modules/STM32F407G-DISC1/module.c b/modules/STM32F407G-DISC1/module.c
index b001a49..a53ac6e 100644
--- a/modules/STM32F407G-DISC1/module.c
+++ b/modules/STM32F407G-DISC1/module.c
@@ -149,7 +149,7 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
 
 #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "STM32F407Discovery";
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
@@ -179,7 +179,7 @@ ROMCONST char* moduleShellPrompt = "STM32F407Discovery";
 /*===========================================================================*/
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 /** @} */
diff --git a/modules/STM32F407G-DISC1/module.h b/modules/STM32F407G-DISC1/module.h
index 6aaa442..1d1c676 100644
--- a/modules/STM32F407G-DISC1/module.h
+++ b/modules/STM32F407G-DISC1/module.h
@@ -140,7 +140,7 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
@@ -215,7 +215,7 @@ extern ROMCONST char* moduleShellPrompt;
 /*===========================================================================*/
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
-#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 /** @} */
 
diff --git a/periphery-lld/periphAL.c b/periphery-lld/periphAL.c
index 536b22c..c137feb 100644
--- a/periphery-lld/periphAL.c
+++ b/periphery-lld/periphAL.c
@@ -58,4 +58,4 @@ void apalDbgPrintf(const char* fmt, ...)
   return;
 }
 
-#endif /* AMIROOS_CFG_DBG == true */
+#endif /* (AMIROOS_CFG_DBG == true) */
diff --git a/periphery-lld/periphAL.h b/periphery-lld/periphAL.h
index 8bc2316..cb31cd7 100644
--- a/periphery-lld/periphAL.h
+++ b/periphery-lld/periphAL.h
@@ -50,14 +50,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #if (AMIROOS_CFG_DBG == true) || defined(__DOXYGEN__)
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   void _apalDbgAssertMsg(const bool c, const char* fmt, ...);
   void apalDbgPrintf(const char* fmt, ...);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /**
  * @brief Assert function to check a given condition.
@@ -67,13 +67,13 @@ extern "C" {
 #define apalDbgAssert(c)                                                      \
   _apalDbgAssertMsg(c, "%s(%u): apalDbgAssert failed", __FILE__, __LINE__);
 
-#else /* AMIROOS_CFG_DBG != true */
+#else /* (AMIROOS_CFG_DBG != true) */
 
 #define apalDbgAssert(constition)
 #define apalDbgAssertMsg(condition, fmt, ...)
 #define apalDbgPrintf(fmt, ...)
 
-#endif /* AMIROOS_CFG_DBG */
+#endif /* (AMIROOS_CFG_DBG == true) */
 
 /*============================================================================*/
 /* GENERAL                                                                    */
@@ -101,7 +101,7 @@ static inline void usleep(apalTime_t us)
 /* GPIO                                                                       */
 /*============================================================================*/
 
-#if HAL_USE_PAL || defined (__DOXYGEN__)
+#if (HAL_USE_PAL == TRUE) || defined (__DOXYGEN__)
 
 /**
  * @brief GPIO driver type.
@@ -212,13 +212,13 @@ static inline apalExitStatus_t apalControlGpioSet(const apalControlGpio_t* const
     (edge == APAL_GPIO_EDGE_FALLING) ? PAL_EVENT_MODE_FALLING_EDGE :  \
      (edge == APAL_GPIO_EDGE_BOTH) ? PAL_EVENT_MODE_BOTH_EDGES : 0)
 
-#endif /* HAL_USE_PAL */
+#endif /* (HAL_USE_PAL == TRUE) */
 
 /*============================================================================*/
 /* PWM                                                                        */
 /*============================================================================*/
 
-#if HAL_USE_PWM || defined (__DOXYGEN__)
+#if (HAL_USE_PWM == TRUE) || defined (__DOXYGEN__)
 
 /**
  * @brief PWM driver type.
@@ -276,13 +276,13 @@ static inline apalExitStatus_t apalPWMGetPeriod(apalPWMDriver_t* pwm, apalPWMper
   return APAL_STATUS_OK;
 }
 
-#endif /* HAL_USE_PWM */
+#endif /* (HAL_USE_PWM == TRUE) */
 
 /*============================================================================*/
 /* QEI                                                                        */
 /*============================================================================*/
 
-#if HAL_USE_QEI || defined (__DOXYGEN__)
+#if (HAL_USE_QEI == TRUE) || defined (__DOXYGEN__)
 
 /**
  * @brief QEI driver type.
@@ -343,13 +343,13 @@ static inline apalExitStatus_t apalQEIGetRange(apalQEIDriver_t* qei, apalQEICoun
   return APAL_STATUS_OK;
 }
 
-#endif /* HAL_USE_QEI */
+#endif /* (HAL_USE_QEI == TRUE) */
 
 /*============================================================================*/
 /* I2C                                                                        */
 /*============================================================================*/
 
-#if HAL_USE_I2C || defined(__DOXYGEN__)
+#if (HAL_USE_I2C == TRUE) || defined(__DOXYGEN__)
 
 /**
  * @brief I2C driver type.
@@ -379,7 +379,7 @@ static inline apalExitStatus_t apalI2CMasterTransmit(apalI2CDriver_t* i2cd, cons
   if (!i2cd_locked_external) {
     i2cAcquireBus(i2cd);
   }
-#endif
+#endif /* (I2C_USE_MUTUAL_EXCLUSION == TRUE) */
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wtype-limits"
@@ -393,25 +393,25 @@ static inline apalExitStatus_t apalI2CMasterTransmit(apalI2CDriver_t* i2cd, cons
   } else {
     status = i2cMasterTransmitTimeout(i2cd, addr, txbuf, txbytes, rxbuf, rxbytes, ((timeout >= TIME_INFINITE) ? TIME_INFINITE : TIME_US2I(timeout)) );
   }
-#else
+#else /* defined(STM32F1XX_I2C) */
   const msg_t status = i2cMasterTransmitTimeout(i2cd, addr, txbuf, txbytes, rxbuf, rxbytes, ((timeout >= TIME_INFINITE) ? TIME_INFINITE : TIME_US2I(timeout)) );
-#endif
+#endif /* defined(STM32F1XX_I2C) */
 #pragma GCC diagnostic pop
 
 #if (I2C_USE_MUTUAL_EXCLUSION == TRUE)
   if (!i2cd_locked_external) {
     i2cReleaseBus(i2cd);
   }
-#endif
+#endif /* (I2C_USE_MUTUAL_EXCLUSION == TRUE) */
 
   switch (status)
   {
     case MSG_OK:
 #if defined(STM32F1XX_I2C)
       return (rxbytes != 1) ? APAL_STATUS_OK : APAL_STATUS_WARNING;
-#else
+#else /* defined(STM32F1XX_I2C) */
       return APAL_STATUS_OK;
-#endif
+#endif /* defined(STM32F1XX_I2C) */
     case MSG_TIMEOUT:
       return APAL_STATUS_TIMEOUT;
     case MSG_RESET:
@@ -441,7 +441,7 @@ static inline apalExitStatus_t apalI2CMasterReceive(apalI2CDriver_t* i2cd, const
   if (!i2cd_locked_external) {
     i2cAcquireBus(i2cd);
   }
-#endif
+#endif /* (I2C_USE_MUTUAL_EXCLUSION == TRUE) */
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wtype-limits"
@@ -455,25 +455,25 @@ static inline apalExitStatus_t apalI2CMasterReceive(apalI2CDriver_t* i2cd, const
   } else {
     status = i2cMasterReceiveTimeout(i2cd, addr, rxbuf, rxbytes, ((timeout >= TIME_INFINITE) ? TIME_INFINITE : TIME_US2I(timeout)) );
   }
-#else
+#else /* defined(STM32F1XX_I2C) */
   const msg_t status = i2cMasterReceiveTimeout(i2cd, addr, rxbuf, rxbytes, ((timeout >= TIME_INFINITE) ? TIME_INFINITE : TIME_US2I(timeout)) );
-#endif
+#endif /* defined(STM32F1XX_I2C) */
 #pragma GCC diagnostic pop
 
 #if (I2C_USE_MUTUAL_EXCLUSION == TRUE)
   if (!i2cd_locked_external) {
     i2cReleaseBus(i2cd);
   }
-#endif
+#endif /* (I2C_USE_MUTUAL_EXCLUSION == TRUE) */
 
   switch (status)
   {
     case MSG_OK:
 #if defined(STM32F1XX_I2C)
       return (rxbytes != 1) ? APAL_STATUS_OK : APAL_STATUS_WARNING;
-#else
+#else /* defined(STM32F1XX_I2C) */
       return APAL_STATUS_OK;
-#endif
+#endif /* defined(STM32F1XX_I2C) */
     case MSG_TIMEOUT:
       return APAL_STATUS_TIMEOUT;
     case MSG_RESET:
@@ -482,13 +482,13 @@ static inline apalExitStatus_t apalI2CMasterReceive(apalI2CDriver_t* i2cd, const
   }
 }
 
-#endif /* HAL_USE_I2C */
+#endif /* (HAL_USE_I2C == TRUE) */
 
 /*============================================================================*/
 /* SPI                                                                        */
 /*============================================================================*/
 
-#if HAL_USE_SPI || defined(__DOXYGEN__)
+#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__)
 
 /**
  * @brief SPI driver type.
@@ -509,23 +509,23 @@ static inline apalExitStatus_t apalSPIExchange(apalSPIDriver_t* spid, const uint
 {
   apalDbgAssert(spid != NULL);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   // check whether the SPI driver was locked externally
   const bool spid_locked_external = spid->mutex.owner == currp;
   if (!spid_locked_external) {
     spiAcquireBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   spiSelect(spid);
   spiExchange(spid, length, txData, rxData);
   spiUnselect(spid);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   if (!spid_locked_external) {
     spiReleaseBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   return APAL_STATUS_OK;
 }
@@ -543,23 +543,23 @@ static inline apalExitStatus_t apalSPIReceive(apalSPIDriver_t* spid, uint8_t* co
 {
   apalDbgAssert(spid != NULL);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   // check whether the SPI driver was locked externally
   const bool spid_locked_external = spid->mutex.owner == currp;
   if (!spid_locked_external) {
     spiAcquireBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   spiSelect(spid);
   spiReceive(spid, length, data);
   spiUnselect(spid);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   if (!spid_locked_external) {
     spiReleaseBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   return APAL_STATUS_OK;
 }
@@ -577,23 +577,23 @@ static inline apalExitStatus_t apalSPITransmit(apalSPIDriver_t* spid, const uint
 {
   apalDbgAssert(spid != NULL);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   // check whether the SPI driver was locked externally
   const bool spid_locked_external = spid->mutex.owner == currp;
   if (!spid_locked_external) {
     spiAcquireBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   spiSelect(spid);
   spiSend(spid, length, data);
   spiUnselect(spid);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   if (!spid_locked_external) {
     spiReleaseBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   return APAL_STATUS_OK;
 }
@@ -613,28 +613,28 @@ static inline apalExitStatus_t apalSPITransmitAndReceive(apalSPIDriver_t* spid,
 {
   apalDbgAssert(spid != NULL);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   // check whether the SPI driver was locked externally
   const bool spid_locked_external = spid->mutex.owner == currp;
   if (!spid_locked_external) {
     spiAcquireBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   spiSelect(spid);
   spiSend(spid, txLength, txData);
   spiReceive(spid, rxLength, rxData);
   spiUnselect(spid);
 
-#if (SPI_USE_MUTUAL_EXCLUSION)
+#if (SPI_USE_MUTUAL_EXCLUSION == TRUE)
   if (!spid_locked_external) {
     spiReleaseBus(spid);
   }
-#endif
+#endif /* (SPI_USE_MUTUAL_EXCLUSION == TRUE) */
 
   return APAL_STATUS_OK;
 }
 
-#endif /* HAL_USE_SPI */
+#endif /* (HAL_USE_SPI == TRUE) */
 
 #endif /* AMIROOS_PERIPHAL_H */
diff --git a/unittests/lld/inc/ut_lld_adc.h b/unittests/lld/inc/ut_lld_adc.h
index 66f8625..ceed031 100644
--- a/unittests/lld/inc/ut_lld_adc.h
+++ b/unittests/lld/inc/ut_lld_adc.h
@@ -63,13 +63,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAdcFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_A3906_v1.h b/unittests/periphery-lld/inc/ut_alld_A3906_v1.h
index 009c895..788cd8d 100644
--- a/unittests/periphery-lld/inc/ut_alld_A3906_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_A3906_v1.h
@@ -134,13 +134,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldA3906Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_AT24C01B_v1.h b/unittests/periphery-lld/inc/ut_alld_AT24C01B_v1.h
index d9020af..e239c4e 100644
--- a/unittests/periphery-lld/inc/ut_alld_AT24C01B_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_AT24C01B_v1.h
@@ -68,13 +68,13 @@ typedef struct {
 /* INLINE FUNCTIONS                                                           */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldAt24c01bFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_AT24C01B) && (AMIROLLD_CFG_AT24C01B == 1) */
 
diff --git a/unittests/periphery-lld/inc/ut_alld_AT42QT1050_v1.h b/unittests/periphery-lld/inc/ut_alld_AT42QT1050_v1.h
index cb27918..3619d2b 100644
--- a/unittests/periphery-lld/inc/ut_alld_AT42QT1050_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_AT42QT1050_v1.h
@@ -74,13 +74,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldAt42qt1050Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_DW1000_v0.h b/unittests/periphery-lld/inc/ut_alld_DW1000_v0.h
index f55ecc2..4dfb38d 100755
--- a/unittests/periphery-lld/inc/ut_alld_DW1000_v0.h
+++ b/unittests/periphery-lld/inc/ut_alld_DW1000_v0.h
@@ -49,13 +49,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldDw1000Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_HMC5883L_v1.h b/unittests/periphery-lld/inc/ut_alld_HMC5883L_v1.h
index 8661f76..e8917bb 100644
--- a/unittests/periphery-lld/inc/ut_alld_HMC5883L_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_HMC5883L_v1.h
@@ -74,13 +74,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldHmc5883lFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_INA219_v1.h b/unittests/periphery-lld/inc/ut_alld_INA219_v1.h
index 9151ca2..86f0297 100644
--- a/unittests/periphery-lld/inc/ut_alld_INA219_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_INA219_v1.h
@@ -74,13 +74,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldIna219Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_L3G4200D_v1.h b/unittests/periphery-lld/inc/ut_alld_L3G4200D_v1.h
index 245d5b9..1ed7d78 100644
--- a/unittests/periphery-lld/inc/ut_alld_L3G4200D_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_L3G4200D_v1.h
@@ -74,13 +74,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldL3g4200dFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_LED_v1.h b/unittests/periphery-lld/inc/ut_alld_LED_v1.h
index 310e510..1d3d1c3 100644
--- a/unittests/periphery-lld/inc/ut_alld_LED_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_LED_v1.h
@@ -49,13 +49,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldLedFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_LIS331DLH_v1.h b/unittests/periphery-lld/inc/ut_alld_LIS331DLH_v1.h
index f14a3d4..91c35cc 100644
--- a/unittests/periphery-lld/inc/ut_alld_LIS331DLH_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_LIS331DLH_v1.h
@@ -74,13 +74,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldLis331dlhFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_LTC4412_v1.h b/unittests/periphery-lld/inc/ut_alld_LTC4412_v1.h
index 5b4dbf1..00fa63b 100644
--- a/unittests/periphery-lld/inc/ut_alld_LTC4412_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_LTC4412_v1.h
@@ -49,13 +49,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldLtc4412Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_MPR121_v1.h b/unittests/periphery-lld/inc/ut_alld_MPR121_v1.h
index 098b3d0..a7e5da7 100644
--- a/unittests/periphery-lld/inc/ut_alld_MPR121_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_MPR121_v1.h
@@ -74,13 +74,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldMpr121Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_MPU6050_v1.h b/unittests/periphery-lld/inc/ut_alld_MPU6050_v1.h
index 926f6f2..e33988b 100644
--- a/unittests/periphery-lld/inc/ut_alld_MPU6050_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_MPU6050_v1.h
@@ -64,13 +64,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldMpu6050Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_PCA9544A_v1.h b/unittests/periphery-lld/inc/ut_alld_PCA9544A_v1.h
index 0a7a750..98921d9 100644
--- a/unittests/periphery-lld/inc/ut_alld_PCA9544A_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_PCA9544A_v1.h
@@ -64,13 +64,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldPca9544aFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_PCAL6524_v1.h b/unittests/periphery-lld/inc/ut_alld_PCAL6524_v1.h
index 7cc7151..e2bab5d 100644
--- a/unittests/periphery-lld/inc/ut_alld_PCAL6524_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_PCAL6524_v1.h
@@ -64,13 +64,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldPcal6524Func(BaseSequentialStream* stream, aos_unittest_t *ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_PKxxxExxx_v1.h b/unittests/periphery-lld/inc/ut_alld_PKxxxExxx_v1.h
index 60136b1..98caf71 100644
--- a/unittests/periphery-lld/inc/ut_alld_PKxxxExxx_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_PKxxxExxx_v1.h
@@ -64,13 +64,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldPkxxxexxxFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_TLC5947_v1.h b/unittests/periphery-lld/inc/ut_alld_TLC5947_v1.h
index 2199a95..0c10096 100644
--- a/unittests/periphery-lld/inc/ut_alld_TLC5947_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_TLC5947_v1.h
@@ -49,13 +49,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldTlc5947Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_TPS20xxB_v1.h b/unittests/periphery-lld/inc/ut_alld_TPS20xxB_v1.h
index 7c264bf..689f5c3 100644
--- a/unittests/periphery-lld/inc/ut_alld_TPS20xxB_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_TPS20xxB_v1.h
@@ -49,13 +49,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldTps20xxbFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1.h b/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1.h
index a158a98..e7630d2 100644
--- a/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1.h
@@ -49,13 +49,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldTps6211xFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1_INA219_v1.h b/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1_INA219_v1.h
index 5877c9e..e646849 100644
--- a/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1_INA219_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_TPS6211x_v1_INA219_v1.h
@@ -70,13 +70,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldTps6211xIna219Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_VCNL4020_v1.h b/unittests/periphery-lld/inc/ut_alld_VCNL4020_v1.h
index 8140b58..bc7e1f7 100644
--- a/unittests/periphery-lld/inc/ut_alld_VCNL4020_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_VCNL4020_v1.h
@@ -74,13 +74,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldVcnl4020Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_bq241xx_v1.h b/unittests/periphery-lld/inc/ut_alld_bq241xx_v1.h
index 244ffca..0804dbf 100644
--- a/unittests/periphery-lld/inc/ut_alld_bq241xx_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_bq241xx_v1.h
@@ -49,13 +49,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldBq241xxFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_bq27500_v1.h b/unittests/periphery-lld/inc/ut_alld_bq27500_v1.h
index 6f974c2..591acdf 100644
--- a/unittests/periphery-lld/inc/ut_alld_bq27500_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_bq27500_v1.h
@@ -64,13 +64,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldBq27500Func(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_bq27500_v1_bq241xx_v1.h b/unittests/periphery-lld/inc/ut_alld_bq27500_v1_bq241xx_v1.h
index a4f371a..9f79180 100644
--- a/unittests/periphery-lld/inc/ut_alld_bq27500_v1_bq241xx_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_bq27500_v1_bq241xx_v1.h
@@ -70,13 +70,13 @@ typedef struct {
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldBq27500Bq241xxFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/inc/ut_alld_dw1000_v1.h b/unittests/periphery-lld/inc/ut_alld_dw1000_v1.h
index d3dc335..f37aa69 100755
--- a/unittests/periphery-lld/inc/ut_alld_dw1000_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_dw1000_v1.h
@@ -50,9 +50,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXTERN DECLARATIONS                                                        */
 /******************************************************************************/
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
-#endif
+#endif /* defined(__cplusplus) */
   aos_utresult_t utAlldDw1000Func(BaseSequentialStream* stream, aos_unittest_t* ut);
 
   extern uint8_t s1switch;
@@ -72,9 +72,9 @@ extern "C" {
   apalGpioState_t port_CheckEXT_IRQ(void) ;
   void process_deca_irq(void);
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-#endif
+#endif /* defined(__cplusplus) */
 
 /******************************************************************************/
 /* INLINE FUNCTIONS                                                           */
diff --git a/unittests/periphery-lld/src/ut_alld_bq27500_v1.c b/unittests/periphery-lld/src/ut_alld_bq27500_v1.c
index 73b0f59..1d32532 100644
--- a/unittests/periphery-lld/src/ut_alld_bq27500_v1.c
+++ b/unittests/periphery-lld/src/ut_alld_bq27500_v1.c
@@ -28,19 +28,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /******************************************************************************/
 
 // change saved unseal keys to test bruteforcing
-#ifdef BQ27500_UT_TEST_BRUTEFORCE
+#if defined(BQ27500_UT_TEST_BRUTEFORCE)
 
-#ifdef BQ27500_LLD_DEFAULT_UNSEAL_KEY0
+#if defined(BQ27500_LLD_DEFAULT_UNSEAL_KEY0)
 #undef BQ27500_LLD_DEFAULT_UNSEAL_KEY0
 #define BQ27500_LLD_DEFAULT_UNSEAL_KEY0 0x1234
-#endif
+#endif /* defined(BQ27500_LLD_DEFAULT_UNSEAL_KEY0) */
 
-#ifdef BQ27500_LLD_DEFAULT_UNSEAL_KEY1
+#if defined(BQ27500_LLD_DEFAULT_UNSEAL_KEY1)
 #undef BQ27500_LLD_DEFAULT_UNSEAL_KEY1
 #define BQ27500_LLD_DEFAULT_UNSEAL_KEY1 0x5678
-#endif
+#endif /* defined(BQ27500_LLD_DEFAULT_UNSEAL_KEY1) */
 
-#endif
+#endif /* defined(BQ27500_UT_TEST_BRUTEFORCE) */
 
 /******************************************************************************/
 /* EXPORTED VARIABLES                                                         */
diff --git a/unittests/periphery-lld/src/ut_alld_dw1000_v1.c b/unittests/periphery-lld/src/ut_alld_dw1000_v1.c
index e5995e7..c5cc995 100755
--- a/unittests/periphery-lld/src/ut_alld_dw1000_v1.c
+++ b/unittests/periphery-lld/src/ut_alld_dw1000_v1.c
@@ -261,7 +261,7 @@ aos_utresult_t utAlldDw1000Func(BaseSequentialStream* stream, aos_unittest_t* ut
 /*! Unit Test snippets for DW1000.
  * @Note: Event IRQ for DW1000 should be tested separately
  */
-#ifdef UNIT_TEST_SNIPPETS_DW1000
+#if defined(UNIT_TEST_SNIPPETS_DW1000)
 
   uint32_t actual_deviceId;
 
@@ -367,7 +367,7 @@ aos_utresult_t utAlldDw1000Func(BaseSequentialStream* stream, aos_unittest_t* ut
 
   /************** End of UNIT_TEST_SNIPPETS_DW1000*****************/
 
-#else
+#else /* defined(UNIT_TEST_SNIPPETS_DW1000) */
 
 
   /*! RUN THE STATE MACHINE DEMO APP (RTLS) */
@@ -395,7 +395,7 @@ aos_utresult_t utAlldDw1000Func(BaseSequentialStream* stream, aos_unittest_t* ut
 //    aosThdUSleep(10);
   }
 
-#endif  /*  UNIT_TEST_SNIPPETS_DW1000 */
+#endif  /* defined(UNIT_TEST_SNIPPETS_DW1000) */
 
   return result;
 }
