Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r31aa23b12f37b9d16b5160369ccb7dab6c6eca4d --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 31aa23b12f37b9d16b5160369ccb7dab6c6eca4d) @@ -35,10 +35,11 @@ #define MAX_VALVE_STATE_MISMATCH_COUNT 3 ///< Maximum number of times commanded valves state can fail to match read back valve states in a row. #define VALVES_STATE_PUB_INTERVAL ( 500 / TASK_PRIORITY_INTERVAL ) ///< Interval ( ms / task time) at which valves states are published on CAN bus. +#define DATA_PUBLISH_COUNTER_START_COUNT 27 ///< Data publish counter start count. // ********** private data ********** -static U32 valvesStatesPublicationTimerCounter = 0; ///< Timer counter used to schedule valve state publication to CAN bus. +static U32 valvesStatesPublicationTimerCounter; ///< Timer counter used to schedule valve state publication to CAN bus. static U16 commandedValvesStates = ALL_VALVES_DEENERGIZED; ///< Initialize commanded valves states bit field. static U32 valveStateMismatchCounter = 0; ///< Initialize valve state mismatch counter. static U32 pendingValveStateChanges[ NUM_OF_VALVES ]; ///< Delayed (pending) valve state changes. @@ -79,7 +80,7 @@ commandedValvesStates = fromU32ArrayToU16(); setFPGAValveStates( commandedValvesStates ); // initially set all valves to de-energized state via FPGA - valvesStatesPublicationTimerCounter = 0; // reset valves states publication timer + valvesStatesPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; // reset valves states publication timer } /*********************************************************************//** @@ -429,7 +430,7 @@ U16 valvesStatus = getFPGAValveStates(); broadcastData( MSG_ID_DG_VALVES_STATES, COMM_BUFFER_OUT_CAN_DG_BROADCAST, (U08*)&valvesStatus, sizeof( U16 ) ); - valvesStatesPublicationTimerCounter = 0; + valvesStatesPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; } }