Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -raf0ce65ce725e352e2b0e1ca2f047bd94afc6e9f -r524d83704e360a97df574ad5d02dc37289e08a59 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision af0ce65ce725e352e2b0e1ca2f047bd94afc6e9f) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 524d83704e360a97df574ad5d02dc37289e08a59) @@ -43,16 +43,16 @@ static U16 valvesStates = INIT_VALVES_STATES; ///< initialize valves states for FPGA to set static U32 valvesStatesPublicationTimerCounter = 0; ///< used to schedule valve state publication to CAN bus static U16 currentValvesStates = INIT_VALVES_STATES; ///< initialize current valves states -static int valveStateMismatchCounter = 0; ///< initialize valve state mismatch counter +static U08 valveStateMismatchCounter = 0; ///< initialize valve state mismatch counter static OVERRIDE_U32_T valves[ NUM_OF_VALVES ]; ///< Current valves states static OVERRIDE_U32_T valvesStatesPublishInterval = { VALVES_STATE_PUB_INTERVAL, VALVES_STATE_PUB_INTERVAL, 0, 0 }; ///< interval (in ms/task interval) at which to publish valves state to CAN bus // ********** private function prototypes ********** static BOOL checkValveStateName( VALVES_T valve, VALVE_STATE_NAMES_T valveState ); ///< check validity of requested valve state name for given valve -U32 convertValveStateNameToValveState(VALVE_STATE_NAMES_T valveState); ///< Convert valve state name to de-/energized valve state -U16 fromU32ArrayToU16( OVERRIDE_U32_T array[ NUM_OF_VALVES ] ); ///< convert array of U32 to U16 for statesValves preparation +static U32 convertValveStateNameToValveState(VALVE_STATE_NAMES_T valveState); ///< Convert valve state name to de-/energized valve state +static U16 fromU32ArrayToU16( OVERRIDE_U32_T array[ NUM_OF_VALVES ] ); ///< convert array of U32 to U16 for statesValves preparation static void publishValvesStates( void ); static DATA_GET_PROTOTYPE( U32, getPublishValvesStatesInterval ); @@ -67,13 +67,13 @@ void initValves( void ) { // initialize current valves states (for both override and actual) - int i; + U08 i; for (i = 0; i < NUM_OF_VALVES; i++) { - valves[ i ].data = 0; - valves[ i ].ovInitData = 0; - valves[ i ].ovData = 0; + valves[ i ].data = DEENERGIZED; + valves[ i ].ovInitData = DEENERGIZED; + valves[ i ].ovData = DEENERGIZED; valves[ i ].override = OVERRIDE_RESET; } @@ -256,7 +256,7 @@ U16 fromU32ArrayToU16( OVERRIDE_U32_T array[ NUM_OF_VALVES ] ) { U16 result = 0; // initialize result flag to 0 - int i; + U08 i; for ( i = 0; i < NUM_OF_VALVES; i++) { @@ -368,7 +368,7 @@ *************************************************************************/ U32 getValveState( U32 valve ) { - int valveState = DEENERGIZED; + U08 valveState = DEENERGIZED; if ( valve < NUM_OF_VALVES ) {