Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r8cf0fafa78ce14b5dbdf95510e957846660ac2b9 -r4c26b49a73736fa697bf7565dd7685c4e1cd599a --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 8cf0fafa78ce14b5dbdf95510e957846660ac2b9) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 4c26b49a73736fa697bf7565dd7685c4e1cd599a) @@ -46,7 +46,7 @@ #include "Valves.h" #include "WatchdogMgmt.h" #include "HDDefs.h" -#include "TaskPriority.h" +#include "TaskPriority.h" /** * @addtogroup SystemCommMessages @@ -8579,6 +8579,30 @@ /*********************************************************************//** * @brief + * The handleSetBootloaderRequest function handles a + * request to set the flag to trigger update mode + * after a reboot. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleSetBootloaderRequest( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = setBootloaderFlag(); + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief * The handleTestHDDialinCheckIn function handles check in from Dialin. * @details Inputs: none * @details Outputs: message handled @@ -8683,6 +8707,28 @@ } /*********************************************************************//** + * The handleEnterBootloaderNowRequest function handles a + * request immediately jump to the bootloader application. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleEnterBootloaderNowRequest( MESSAGE_T *message ) +{ + BOOL result = (0 == message->hdr.payloadLen); + + // respond to request immediately with whether it was formatted correctly + sendTestAckResponseMsg((MSG_ID_T)message->hdr.msgID, result); + + if (result) + { + // Jump to the bootloader, there is no coming back from this. + startBootloader(); + } +} + +/*********************************************************************//** * @brief * The handleTestHDPendingACKOverrideRequest function handles a * request to override pending ACKs. @@ -8747,6 +8793,30 @@ } /*********************************************************************//** + * @brief + * The handleRebootNowRequest function handles a + * request to reboot the system. A software reset will cause the bootloader + * to stay active. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleRebootNowRequest( MESSAGE_T *message ) +{ + BOOL result = (0 == message->hdr.payloadLen); + + // respond to request immediately with whether it was formatted correctly + sendTestAckResponseMsg((MSG_ID_T)message->hdr.msgID, result); + + if (result) + { + // Trigger a software reset. + systemREG1->SYSECR = (0x2) << 14; + } +} + +/*********************************************************************//** * @brief * The handleGetHDInstitutionalRecord function handles a request to get the HD * institutional record.