Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r046bc2b62cf942b7e846fa5bff698b94238edf24 -r6ffea0047812fd93e644b789071d410a15d53fee --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 046bc2b62cf942b7e846fa5bff698b94238edf24) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 6ffea0047812fd93e644b789071d410a15d53fee) @@ -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