Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r2d295ca85f19e95da42476a57ca6b4496baf980a -reb159befbbeae67205fb6b55d75743aa4d48c9b0 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 2d295ca85f19e95da42476a57ca6b4496baf980a) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision eb159befbbeae67205fb6b55d75743aa4d48c9b0) @@ -289,6 +289,7 @@ { MSG_ID_FP_CONDUCTIVITY_SENSOR_VERSION_REQUEST, &testHandleConductivitySensorVersionRequest }, { MSG_ID_DD_TEMPERATURE_SENSOR_FILTERED_TEMP_OVERRIDE_REQUEST, &testDDTemperatureSensorFilteredReadingsOverride }, { MSG_ID_FP_SET_RECOVERY_VALVES_REQUEST, &testIOFPSetValveRecoveryConfig }, + { MSG_ID_FFU_SIGNAL_DD_UPDATE_AVAILABLE, &handleUpdateAvailable }, }; /// Calculation for number of entries in the incoming message function handler look-up table. @@ -768,7 +769,45 @@ return result; } +/*********************************************************************//** + * @brief + * The resetMicroControllerUnit function resets the MCU. + * @details \b Inputs: none + * @details \b Outputs: none + * @return none + *************************************************************************/ +void resetMicroControllerUnit( void ) +{ + setSystemREG1_SYSECR( (0x2) << 14 ); // Reset processor +} +/*********************************************************************//** + * @brief + * The handleUpdateAvailable function handles a request from the + * Firmware FPGA Updater (FFU) to reset the TD firmware processor. + * @note If reset is successful, this function will not return. + * @details \b Inputs: none + * @details \b Outputs: TD processor soft reset if request is valid + * @param message Pointer to the reset request message + * @return FALSE if reset command rejected + *************************************************************************/ +BOOL handleUpdateAvailable( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // Verify payload length + if ( 0 == message->hdr.payloadLen ) + { // S/w reset of processor + result = TRUE; // Reset will prevent this from getting transmitted though + requestNewOperationMode( DD_MODE_UPDT ); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DD_2_UI, result ); + + return result; +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ @@ -904,7 +943,7 @@ if ( 0 == message->hdr.payloadLen ) { // S/w reset of processor result = TRUE; // Reset will prevent this from getting transmitted though - setSystemREG1_SYSECR( (0x2) << 14 ); // Reset processor + resetMicroControllerUnit(); } return result;