Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -r6ba61903be56ce79582fc9a31e0927df4dafee08 -r6bb0052e068702325c34025ea137059f3746b3b3 --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 6ba61903be56ce79582fc9a31e0927df4dafee08) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 6bb0052e068702325c34025ea137059f3746b3b3) @@ -54,14 +54,15 @@ // ********** private data ********** +static U32 dataPublishCounter; ///< Used to schedule gen idle data publication to CAN bus. static DG_GEN_IDLE_MODE_STATE_T genIdleState; ///< Currently active generation idle state. // NOTE: the bad fill state must be initialized here and not in the transition function since in case of a bad fill, the transition function is called // several times to drain and fill and handle a bad fill. static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T badFillState = DG_HANDLE_BAD_FILL_STATE_START; ///< Initialize bad fill sub-state. static U32 hdLostCommStartTime_ms; ///< Lost communication with HD start time in ms. static U32 targetFillVolumeML; ///< Save the target fill volume before calling startFillCmd(). static BOOL handleBadFillFlag; ///< Internal signal flag to handle bad fill. -static OVERRIDE_U32_T genIdleDataPublicationTimerCounter = { BAD_FILL_SUBSTATES_PUB_INTERVAL, +static OVERRIDE_U32_T genIdleDataPublicationInterval = { BAD_FILL_SUBSTATES_PUB_INTERVAL, BAD_FILL_SUBSTATES_PUB_INTERVAL, 0, 0 }; ///< Interval (in ms) at which to publish bad fill sub-states to CAN bus. @@ -428,7 +429,7 @@ static void publishGenIdleSubstates() { // publish Gen Idle pump data on interval - if ( ++genIdleDataPublicationTimerCounter >= getU32OverrideValue( &genIdleDataPublicationTimerCounter ) ) + if ( ++dataPublishCounter >= getU32OverrideValue( &genIdleDataPublicationInterval ) ) { DG_GEN_IDLE_DATA_T data; @@ -440,7 +441,7 @@ broadcastData( MSG_ID_DG_GEN_IDLE_DATA, COMM_BUFFER_OUT_CAN_DG_BROADCAST, (U08*)&data, sizeof( DG_GEN_IDLE_DATA_T ) ); - genIdleDataPublicationTimerCounter = 0; + dataPublishCounter = 0; } } @@ -466,8 +467,8 @@ if ( TRUE == isTestingActivated() ) { U32 intvl = value / TASK_GENERAL_INTERVAL; - genIdleDataPublicationTimerCounter.ovData = intvl; - genIdleDataPublicationTimerCounter.override = OVERRIDE_KEY; + genIdleDataPublicationInterval.ovData = intvl; + genIdleDataPublicationInterval.override = OVERRIDE_KEY; result = TRUE; } @@ -488,8 +489,8 @@ if ( TRUE == isTestingActivated() ) { - genIdleDataPublicationTimerCounter.override = OVERRIDE_RESET; - genIdleDataPublicationTimerCounter.ovData = genIdleDataPublicationTimerCounter.ovInitData; + genIdleDataPublicationInterval.override = OVERRIDE_RESET; + genIdleDataPublicationInterval.ovData = genIdleDataPublicationInterval.ovInitData; result = TRUE; }