Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rc6acef37b0f60f610748df3670d788ccad11e3c9 -r3fbf8872808789fde9bd0d7304c0a193ddc53fc7 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision c6acef37b0f60f610748df3670d788ccad11e3c9) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 3fbf8872808789fde9bd0d7304c0a193ddc53fc7) @@ -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 @@ -120,6 +120,7 @@ { MSG_ID_UI_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_REQUEST, &bloodPrimeHandleBloodFlowChangeRequest }, { MSG_ID_UI_ADJUST_DISPOSABLES_CONFIRM_REQUEST, &handleAutoLoadRequest }, { MSG_ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_REQUEST, &handleAutoEjectRequest }, + { 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 }, @@ -616,6 +617,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. @@ -684,6 +697,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. @@ -700,7 +739,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 );