Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r8c14bdff486bb7299381f19672bb9761b91c332b -rc0b93a6de34d38d42e7a678b6ced59220e1d14da --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 8c14bdff486bb7299381f19672bb9761b91c332b) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision c0b93a6de34d38d42e7a678b6ced59220e1d14da) @@ -54,20 +54,19 @@ VALVE_POSITION_T commandedPosition; ///< Valve commanded position enum. VALVE_POSITION_T currentPosition; ///< Valve current position enum. VALVE_POSITION_T pendingCommandedPosition; ///< Valve pending position enum. - S16 currentEncPosition; ///< Valve current position in encoder counts. +// S16 currentEncPosition; ///< Valve current position in encoder counts. S16 priorEncPosition; ///< Valve prior position in encoder counts. BOOL hasTransitionBeenRequested; ///< Valve transition request flag. VALVE_STATE_T controlState; ///< Valve control state. U32 valveOpsStartTime; ///< Valve transition start time. - S16 positionsABC[ NUM_OF_VALVE_POSITIONS ]; ///< Valve positions (in encoder counts) for positions A, B, and C. - U32 overCurrentCounter; ///< Valve over current counter. - U32 positionOutOfRangeCounter; ///< Valve position out of range counter. +// S16 positionsABC[ NUM_OF_VALVE_POSITIONS ]; ///< Valve positions (in encoder counts) for positions A, B, and C. +// U32 overCurrentCounter; ///< Valve over current counter. +// U32 positionOutOfRangeCounter; ///< Valve position out of range counter. // Homing variables BOOL hasHomingBeenRequested; ///< Valve homing request flag. BOOL hasValveBeenHomed; ///< Valve homing completed flag. - BOOL hasValveBeenReset; ///< Valve homing has valve been reset. - S16 currentMaxEncPositionCnt; ///< Valve homing current maximum encoder position counts. - S16 previousMaxEncPositionCnt; ///< Valve homing previous maximum encoder position counts. +// S16 currentMaxEncPositionCnt; ///< Valve homing current maximum encoder position counts. +// S16 previousMaxEncPositionCnt; ///< Valve homing previous maximum encoder position counts. } VALVE_STATUS_T; /// Payload record structure for pinch valve set position request @@ -90,23 +89,23 @@ static VALVE_STATUS_T currentValveStates[ NUM_OF_VALVES ]; ///< Current status of each valve. static U32 valvesDataPublicationTimerCounter; ///< Valves data broadcast timer counter. static OVERRIDE_U32_T valvesDataPublishInterval; ///< Valves data broadcast interval (in ms). -static SELF_TEST_STATUS_T valvesSelfTestResult; ///< Valves self test result. +//static SELF_TEST_STATUS_T valvesSelfTestResult; ///< Valves self test result. //static TD_VALVES_CAL_RECORD_T valvesCalibrationRecord; ///< Valves calibration record. // ********** private function prototypes ********** static VALVE_STATE_T handleValvesWait4PostState( VALVE_T valve ); -static VALVE_STATE_T handleValvesResetValve( VALVE_T valve ); -static VALVE_STATE_T handleValvesResetEncoder( VALVE_T valve ); -static VALVE_STATE_T handleValvesEnableValve( VALVE_T valve ); +//static VALVE_STATE_T handleValvesResetValve( VALVE_T valve ); +//static VALVE_STATE_T handleValvesResetEncoder( VALVE_T valve ); +//static VALVE_STATE_T handleValvesEnableValve( VALVE_T valve ); static VALVE_STATE_T handleValvesNotHomedState( VALVE_T valve ); -static VALVE_STATE_T handleValvesFindEnergizedEdgeState( VALVE_T valve ); -static VALVE_STATE_T handleValvesFindDeenergizedEdgeState( VALVE_T valve ); +//static VALVE_STATE_T handleValvesFindEnergizedEdgeState( VALVE_T valve ); +//static VALVE_STATE_T handleValvesFindDeenergizedEdgeState( VALVE_T valve ); static VALVE_STATE_T handleValvesIdleState( VALVE_T valve ); static VALVE_STATE_T handleValvesTransitionState( VALVE_T valve ); -static void checkValveInRange( VALVE_T valve, SW_FAULT_ID_T SWFault ); -static BOOL hasEdgeBeenReached( VALVE_T valve ); -static S16 convertCountToDivision8( S16 count ); +//static void checkValveInRange( VALVE_T valve, SW_FAULT_ID_T SWFault ); +//static BOOL hasEdgeBeenReached( VALVE_T valve ); +//static S16 convertCountToDivision8( S16 count ); static void publishValvesData( void ); /*********************************************************************//** @@ -324,33 +323,33 @@ publishValvesData(); } +///*********************************************************************//** +// * @brief +// * The execValvesSelfTest function executes the valves self-test. Calibration +// * factors are loaded from non-volatile memory and CRC checked. +// * @details \b Inputs: Calibration record stored in non-volatile memory. +// * @details \b Outputs: valvesCalibrationRecord +// * @return self-test result (pass/fail) +// *************************************************************************/ +//SELF_TEST_STATUS_T execValvesSelfTest( void ) +//{ +// BOOL calStatus = TRUE; /* TODO getNVRecord2Driver( GET_CAL_VALVES, (U08*)&valvesCalibrationRecord, sizeof( HD_VALVES_CAL_RECORD_T ), +// NUM_OF_CAL_DATA_HD_VALVES, ALARM_ID_NO_ALARM );*/ +// +// if ( TRUE == calStatus ) +// { +// valvesSelfTestResult = SELF_TEST_STATUS_PASSED; +// } +// else +// { +// valvesSelfTestResult = SELF_TEST_STATUS_FAILED; +// } +// +// return valvesSelfTestResult; +//} +// /*********************************************************************//** * @brief - * The execValvesSelfTest function executes the valves self-test. Calibration - * factors are loaded from non-volatile memory and CRC checked. - * @details \b Inputs: Calibration record stored in non-volatile memory. - * @details \b Outputs: valvesCalibrationRecord - * @return self-test result (pass/fail) - *************************************************************************/ -SELF_TEST_STATUS_T execValvesSelfTest( void ) -{ - BOOL calStatus = TRUE; /* TODO getNVRecord2Driver( GET_CAL_VALVES, (U08*)&valvesCalibrationRecord, sizeof( HD_VALVES_CAL_RECORD_T ), - NUM_OF_CAL_DATA_HD_VALVES, ALARM_ID_NO_ALARM );*/ - - if ( TRUE == calStatus ) - { - valvesSelfTestResult = SELF_TEST_STATUS_PASSED; - } - else - { - valvesSelfTestResult = SELF_TEST_STATUS_FAILED; - } - - return valvesSelfTestResult; -} - -/*********************************************************************//** - * @brief * The handleValvesWait4PostState function handles the Wait for POST state * of the state machine for a given valve. * @details \b Inputs: current operating mode