Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r290cac3c0557c978647cef2972800dfe137dd662 -rdc883aab56e769b2dec294e084f1378a178ba089 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 290cac3c0557c978647cef2972800dfe137dd662) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision dc883aab56e769b2dec294e084f1378a178ba089) @@ -62,6 +62,7 @@ static U32 valveStateMismatchTimerCounter; ///< Initialize valve state mismatch timer. static U32 pendingValveStateChanges[ DD_NUM_OF_VALVES ]; ///< Delayed (pending) valve state changes. static U32 pendingValveStateChangeCountDowns[ DD_NUM_OF_VALVES ]; ///< Delayed (pending) valve state change count down timers (in task intervals). +static RECOVERY_STATE_T recoveryState; ///< IOFP valve recovery setting. static OVERRIDE_U32_T valveStates[ DD_NUM_OF_VALVES ]; ///< Currently commanded valves states. static OVERRIDE_U32_T valveSensedStates[ DD_NUM_OF_VALVES ]; ///< Valve sensed states override. @@ -97,6 +98,7 @@ fpValveStatesPublishInterval.ovData = VALVES_STATE_PUB_INTERVAL; fpValveStatesPublishInterval.ovInitData = 0; fpValveStatesPublishInterval.override = OVERRIDE_RESET; + recoveryState = MAX_RECOVERY; // Initialize commanded valve states for ( i = 0; i < DD_NUM_OF_VALVES; i++ ) @@ -535,7 +537,6 @@ { // TODO define hdInstitutionalRecord and get the NVData when it's ready // RECOVERY_STATE_T recoveryState = (RECOVERY_STATE_T)hdInstitutionalRecord.recoveryConfig; - RECOVERY_STATE_T recoveryState = MAX_RECOVERY; // Set all P33, P34 and P37 valves per recovery configuration switch( recoveryState ) @@ -566,6 +567,18 @@ /*********************************************************************//** * @brief + * The getRecoveryState function gets the current valve recovery state. + * @details \b Inputs: recoveryState + * @details \b Outputs: recoveryState + * @return the current valve recovery state. + *************************************************************************/ +RECOVERY_STATE_T getRecoveryState( void ) +{ + return recoveryState; +} + +/*********************************************************************//** + * @brief * The publishValvesStates function publishes DD valves states at the set interval. * @details \b Inputs: valvesStatesPublicationTimerCounter * @details \b Outputs: valvesStatesPublicationTimerCounter