Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r909d4064e98d5684ee139534f0ac6cbc5f8774d5 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 909d4064e98d5684ee139534f0ac6cbc5f8774d5) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -7,8 +7,8 @@ * * @file OperationModes.c * -* @author (last) Dara Navaei -* @date (last) 27-May-2026 +* @author (last) suresh +* @date (last) 04-Aug-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -17,6 +17,7 @@ #include "gio.h" +#include "Buttons.h" #include "Messaging.h" #include "ModeFault.h" #include "ModeInitPOST.h" @@ -28,6 +29,7 @@ #include "ModeUpdate.h" //#include "NVDataMgmt.h" #include "OperationModes.h" +#include "SystemCommTD.h" #include "TaskGeneral.h" #include "Timers.h" @@ -150,7 +152,8 @@ newMode = arbitrateModeRequest(); // Will return current mode if no pending requests #ifndef TEST_UI_ONLY - // Verify mode transition is legal unless tester working with system TODO - restore check when all modes are implemented + // Verify mode transition is legal unless tester working with system + //TODO - restore check when all modes are implemented // if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) { newMode = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; @@ -160,7 +163,8 @@ // Is requested new mode valid and legal at this time? if ( newMode >= MODE_NLEG ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_ILLEGAL_MODE_TRANSITION_REQUESTED, newMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, + SW_FAULT_ID_OP_MODES_ILLEGAL_MODE_TRANSITION_REQUESTED, newMode ) newMode = currentMode; } @@ -175,7 +179,8 @@ if ( MODE_TREA == lastMode ) { // If the last mode is treatment but the new mode is not treatment - // it means the treatment is done. Get the elapsed time since the beginning of the treatment and convert it to hours to be written + // it means the treatment is done. Get the elapsed time since the + // beginning of the treatment and convert it to hours to be written U32 txElapsedTimeMS = calcTimeSince( getTreatmentStartTimeStamp() ); F32 txElapsedTimeHrs = (F32)txElapsedTimeMS / ( (F32)( MIN_PER_HOUR * SEC_PER_MIN * MS_PER_SECOND ) ); @@ -221,15 +226,18 @@ break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_STATE, currentMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, + SW_FAULT_ID_OP_MODES_INVALID_MODE_STATE, + currentMode ) currentMode = MODE_FAUL; currentSubMode = 0; break; } // End switch #ifndef _VECTORCAST_ // Send operation status event when appropriate - if ( ( priorSubMode != currentSubMode ) || ( priorSubState != currentSubState ) || ( prior4thLevelState != current4thLevelState ) ) + if ( ( priorSubMode != currentSubMode ) || ( priorSubState != currentSubState ) + || ( prior4thLevelState != current4thLevelState ) ) #endif { sendOperationStatusEvent(); @@ -340,7 +348,9 @@ // signalAlarmActionToPostTreatmentMode( action ); // break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_TO_SIGNAL_ACTION, currentMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, + SW_FAULT_ID_OP_MODES_INVALID_MODE_TO_SIGNAL_ACTION, + currentMode ) break; } } @@ -450,13 +460,15 @@ broadcastModeIntervalCtr = 0; data.opMode = (U32)currentMode; data.subMode = currentSubMode; - broadcastData( MSG_ID_TD_OP_MODE_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, (U08*)&data, sizeof( OP_MODE_PAYLOAD_T ) ); + broadcastData( MSG_ID_TD_OP_MODE_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, + (U08*)&data, sizeof( OP_MODE_PAYLOAD_T ) ); } } /*********************************************************************//** * @brief * The getConfirmationRequestStatus function returns the status of a confirmation request + * @details \b Message \b Sent: MSG_ID_TD_UI_GENERIC_CONFIRMATION_REQUEST * @details \b Inputs: confirmRequests[] * @details \b Outputs: confirmRequests[] consumed/cleared if completed. * @param requestID ID of confirmation being requested @@ -546,14 +558,17 @@ /*********************************************************************//** * @brief * The addConfirmationRequest function sends a confirmation request to UI + * @details \b Message \b Sent: MSG_ID_TD_UI_GENERIC_CONFIRMATION_REQUEST * @details \b Inputs: confirmRequests[] * @details \b Outputs: confirmRequests[] new added. * @param requestID ID of confirmation being requested * @param requestType Type of confirmation being requested (open, close, reject) * @param rejectReason Reason for reject if type is reject * @return request ID - will be non-zero if added *************************************************************************/ -GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, GENERIC_CONFIRM_COMMAND_T requestType, U32 rejectReason ) +GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, + GENERIC_CONFIRM_COMMAND_T requestType, + U32 rejectReason ) { U32 i; BOOL confirmAlreadyPending = FALSE;