Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r647eb56990d69caaed6442fcaf4ba9ae4461cd00 -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 647eb56990d69caaed6442fcaf4ba9ae4461cd00) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file OperationModes.c * -* @author (last) Sean Nash -* @date (last) 16-Aug-2023 +* @author (last) Dara Navaei +* @date (last) 12-Oct-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -62,6 +62,7 @@ static U32 broadcastModeIntervalCtr; ///< Interval counter used to determine when to broadcast operation mode. Initialize to 11 to stagger broadcast. static U32 currentSubState; ///< current sub state. static U32 current4thLevelState; ///< current 4th level state. + /// Interval (in task intervals) at which to publish operation mode data to CAN bus. static OVERRIDE_U32_T opModePublishInterval = { BROADCAST_HD_OP_MODE_INTERVAL, BROADCAST_HD_OP_MODE_INTERVAL, BROADCAST_HD_OP_MODE_INTERVAL, 0 }; /// Local structure init for saving confirmation requests @@ -164,7 +165,7 @@ transitionToNewOperationMode( newMode ); currentMode = newMode; - if ( ( MODE_TREA == lastMode ) && ( currentMode != MODE_TREA ) ) + 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 @@ -218,8 +219,10 @@ break; } // End switch +#ifndef _VECTORCAST_ // Send operation status event when appropriate if ( ( priorSubMode != currentSubMode ) || ( priorSubState != currentSubState ) || ( prior4thLevelState != current4thLevelState ) ) +#endif { sendOperationStatusEvent(); SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_SUB_MODE_CHANGE, priorSubMode, currentSubMode )