Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rc288f2956e37f1f0b964b077af7c39b6387a5df6 -rd913a6ef52c316170124fe56ed66b2976df9782f --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision c288f2956e37f1f0b964b077af7c39b6387a5df6) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision d913a6ef52c316170124fe56ed66b2976df9782f) @@ -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 @@ -130,6 +130,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 }, @@ -625,6 +626,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. @@ -693,6 +706,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. @@ -709,7 +748,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 );