commit fc7151bbed55fc4b7fa1f3becb10ba4a75bc21db
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Thu Mar 14 14:32:41 2019 +0100

    Introduced new LightRing v1.2 module.
    Version number has been rolled back to 1.1.3, since no new functionality has been introduced with the latest commits, but just new modules and some fixes.

diff --git a/Target/Modules/DiWheelDrive_1-1/Boot/main.c b/Target/Modules/DiWheelDrive_1-1/Boot/main.c
index 6cfc70a..e9ca958 100644
--- a/Target/Modules/DiWheelDrive_1-1/Boot/main.c
+++ b/Target/Modules/DiWheelDrive_1-1/Boot/main.c
@@ -47,7 +47,7 @@
 #define RESET_TIMEOUT_MS    100
 
 /****************************************************************************************
-* Function prototypes
+* Function prototypes and static variables
 ****************************************************************************************/
 static void Init(void);
 
@@ -78,7 +78,7 @@ void blCallbackHandleShutdownRequest(void);
 
 const blCallbackTable_t cbtable __attribute__ ((section ("_callback_table"))) = {
   .magicNumber = BL_MAGIC_NUMBER,
-  .vBootloader = {BL_VERSION_ID_AMiRoBLT_Beta, BL_VERSION_MAJOR, BL_VERSION_MINOR, 0},
+  .vBootloader = {BL_VERSION_ID_AMiRoBLT_Beta, BL_VERSION_MAJOR, BL_VERSION_MINOR, 3},
   .vSSSP = {BL_VERSION_ID_SSSP, BL_SSSP_VERSION_MAJOR, BL_SSSP_VERSION_MINOR, 0},
   .vCompiler = {BL_VERSION_ID_GCC, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__},  // currently only GCC is supported
   .cbShutdownHibernate = blCallbackShutdownHibernate,
@@ -306,7 +306,6 @@ static void Init(void)
   /* CNF2[1:0] = %01 and MODE2[1:0] = %00 */
   GPIOA->CRH |= (blt_int32u)((blt_int32u)0x4 << 8);
 #endif
-
 } /*** end of Init ***/
 
 /*
@@ -458,7 +457,7 @@ void shutdownToTransportation(const blt_bool exec_disambiguation) {
   /* wait for all boards to be ready for shutdown */
   GPIO_SetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   if (GPIO_ReadInputDataBit(SYS_REG_EN_GPIO, SYS_REG_EN_PIN) == Bit_SET) {
-    // this must skipped if the pullup voltage (VIO3.3) is not active
+    // this must be skipped if the pullup voltage (VIO3.3) is not active
     setLed(BLT_TRUE);
     waitForSignal(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN, Bit_SET);
     setLed(BLT_FALSE);
@@ -502,7 +501,7 @@ void shutdownToDeepsleep(const blt_bool exec_disambiguation) {
   /* wait for all boards to be ready for shutdown */
   GPIO_SetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   if (GPIO_ReadInputDataBit(SYS_REG_EN_GPIO, SYS_REG_EN_PIN) == Bit_SET) {
-    // this must skipped if the pullup voltage (VIO3.3) is not active
+    // this must be skipped if the pullup voltage (VIO3.3) is not active
     setLed(BLT_TRUE);
     waitForSignal(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN, Bit_SET);
     setLed(BLT_FALSE);
@@ -546,7 +545,7 @@ void shutdownToHibernate(const blt_bool exec_disambiguation) {
   /* wait for all boards to be ready for shutdown */
   GPIO_SetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   if (GPIO_ReadInputDataBit(SYS_REG_EN_GPIO, SYS_REG_EN_PIN) == Bit_SET) {
-    // this must skipped if the pullup voltage (VIO3.3) is not active
+    // this must be skipped if the pullup voltage (VIO3.3) is not active
     setLed(BLT_TRUE);
     waitForSignal(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN, Bit_SET);
     setLed(BLT_FALSE);
@@ -567,7 +566,7 @@ void shutdownToHibernate(const blt_bool exec_disambiguation) {
   PWR_EnterSTANDBYMode();
 
   return;
-} /* end of shutdownToHibernate ***/
+} /*** end of shutdownToHibernate ***/
 
 /*
  * Final shutdown of the system and restart.
@@ -589,7 +588,7 @@ void shutdownAndRestart(const blt_bool exec_disambiguation) {
   /* wait for all boards to be ready for shutdown */
   GPIO_SetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   if (GPIO_ReadInputDataBit(SYS_REG_EN_GPIO, SYS_REG_EN_PIN) == Bit_SET) {
-    // this must skipped if the pullup voltage (VIO3.3) is not active
+    // this must be skipped if the pullup voltage (VIO3.3) is not active
     setLed(BLT_TRUE);
     waitForSignal(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN, Bit_SET);
     setLed(BLT_FALSE);
@@ -614,7 +613,7 @@ void shutdownAndRestart(const blt_bool exec_disambiguation) {
    */
 
   return;
-} /*** end of shutdownAndRestart***/
+} /*** end of shutdownAndRestart ***/
 
 /*
  * Configures some GPIO pins as inputs for safety reasons.
@@ -824,7 +823,7 @@ ErrorStatus handleAccelWakeup() {
  * In transportation low-power mode the system can only be woken up by pulling down the NRST signal.
  * Furthermore, the system can not be charged when in transportation mode.
  */
-void blCallbackShutdownTransportation(void) {
+void blCallbackShutdownTransportation() {
   /* make sure that the required clocks are activated */
   RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD, ENABLE);
@@ -833,9 +832,11 @@ void blCallbackShutdownTransportation(void) {
   GPIO_ResetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   GPIO_ResetBits(SYS_PD_N_GPIO, SYS_PD_N_PIN);
 
-  setLed(BLT_TRUE);
+  /* initialized the standalone timer */
   saTimerInit();
 
+  setLed(BLT_TRUE);
+
   shutdownToTransportation(BLT_TRUE);
 
   return;
@@ -855,8 +856,11 @@ void blCallbackShutdownDeepsleep(void) {
   GPIO_ResetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   GPIO_ResetBits(SYS_PD_N_GPIO, SYS_PD_N_PIN);
 
+  /* initialized the standalone timer */
   saTimerInit();
 
+  setLed(BLT_TRUE);
+
   shutdownToDeepsleep(BLT_TRUE);
 
   return;
@@ -875,8 +879,11 @@ void blCallbackShutdownHibernate(void) {
   GPIO_ResetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   GPIO_ResetBits(SYS_PD_N_GPIO, SYS_PD_N_PIN);
 
+  /* initialized the standalone timer */
   saTimerInit();
 
+  setLed(BLT_TRUE);
+
   shutdownToHibernate(BLT_TRUE);
 
   return;
@@ -891,12 +898,16 @@ void blCallbackShutdownRestart(void) {
   RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD, ENABLE);
 
-  /* set/keep the SYS_SYNC and SYS_PD signal active */
+  /* set/keep the SYS_SYNC and SYS_PD signals active */
   GPIO_ResetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   GPIO_ResetBits(SYS_PD_N_GPIO, SYS_PD_N_PIN);
 
-  /* ensure that all modules had a chance to detect the pulse on SYS_PD_N */
+  /* initialized the standalone timer */
   saTimerInit();
+
+  setLed(BLT_TRUE);
+
+  /* deactivate SYS_PD_N and ensure that all modules had a chance to detect the falling edge */
   msleep(1);
   GPIO_SetBits(SYS_PD_N_GPIO, SYS_PD_N_PIN);
   msleep(1);
@@ -916,7 +927,7 @@ void blCallbackHandleShutdownRequest(void) {
   RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD, ENABLE);
 
-  /* set/keep the SYS_SYNC and SYS_PD signal active */
+  /* set/keep the SYS_SYNC and SYS_PD signals active */
   GPIO_ResetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   GPIO_ResetBits(SYS_PD_N_GPIO, SYS_PD_N_PIN);
 
@@ -933,7 +944,7 @@ void blCallbackHandleShutdownRequest(void) {
   /* wait for all boards to be ready for shutdown */
   GPIO_SetBits(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN);
   if (GPIO_ReadOutputDataBit(SYS_REG_EN_GPIO, SYS_REG_EN_PIN) == Bit_SET) {
-    // this must skipped if the pullup voltage (VIO3.3) is not active
+    // this must be skipped if the pullup voltage (VIO3.3) is not active
     setLed(BLT_TRUE);
     waitForSignal(SYS_SYNC_N_GPIO, SYS_SYNC_N_PIN, Bit_SET);
     setLed(BLT_FALSE);
