Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r5ad0389d9abad0f0a523fc44ae6c00ca8b12f313 -r9c4cdc42d3bcef089a9627b206496cb23bc3f643 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 5ad0389d9abad0f0a523fc44ae6c00ca8b12f313) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 9c4cdc42d3bcef089a9627b206496cb23bc3f643) @@ -7,8 +7,8 @@ * * @file Messaging.c * -* @author (last) Praneeth Bunne -* @date (last) 21-May-2026 +* @author (last) Dara Navaei +* @date (last) 27-May-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -122,6 +122,7 @@ { MSG_ID_UI_ADJUST_DISPOSABLES_CONFIRM_REQUEST, &handleAutoLoadRequest }, { MSG_ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_REQUEST, &handleAutoEjectRequest }, { MSG_ID_UI_BLOOD_PRESSURE_REQUEST, &bpModuleHandleVitalsRequest }, + { MSG_ID_FFU_SIGNAL_TD_UPDATE_AVAILABLE, &handleUpdateAvailable }, { MSG_ID_TD_SOFTWARE_RESET_REQUEST, &testTDSoftwareResetRequest }, { MSG_ID_TD_BUBBLE_OVERRIDE_REQUEST, &testBubbleDetectOverride }, { MSG_ID_TD_BUBBLE_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testBubblesDataPublishIntervalOverride }, @@ -617,6 +618,18 @@ /*********************************************************************//** * @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 sendTestAckResponseMsg function constructs a simple response message * for a handled test message and queues it for transmit on the TD=>PC CAN * channel. @@ -685,6 +698,32 @@ /*********************************************************************//** * @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( MODE_UPDT ); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_TD_2_UI, result ); + + return result; +} + +/*********************************************************************//** + * @brief * The testTDSoftwareResetRequest function handles a request to reset the * TD firmware processor. * @note If reset is successful, this function will not return. @@ -701,7 +740,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(); } sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result );