Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r8f913069e28f0d1913ede0a346ee1525986650d1 -rf05acb2d013aa3dec1b59d793b8876aed928b5aa --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 8f913069e28f0d1913ede0a346ee1525986650d1) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision f05acb2d013aa3dec1b59d793b8876aed928b5aa) @@ -41,53 +41,53 @@ #define VALVE_TRANSITION_TIMEOUT_MS 3000U ///< Valves transition time out in ms /// Valve controller states -typedef enum valve_Control_States +typedef enum Valve_Control_States { - VALVE_STATE_WAIT_FOR_POST = 0, ///< Valve state wait for POST - VALVE_STATE_HOMING_NOT_STARTED, ///< Valve state homing not started - VALVE_STATE_HOMING_FIND_ENERGIZED_EDGE, ///< Valve state homing find energized edge - VALVE_STATE_HOMING_FIND_DEENERGIZED_EDGE, ///< Valve state homing find de-energized edge - VALVE_STATE_IDLE, ///< Valve state idle - VALVE_STATE_IN_TRANSITION, ///< Valve state in transition - NUM_OF_VALVE_STATES, ///< Number of valve exec states + VALVE_STATE_WAIT_FOR_POST = 0, ///< Valve state wait for POST + VALVE_STATE_HOMING_NOT_STARTED, ///< Valve state homing not started + VALVE_STATE_HOMING_FIND_ENERGIZED_EDGE, ///< Valve state homing find energized edge + VALVE_STATE_HOMING_FIND_DEENERGIZED_EDGE, ///< Valve state homing find de-energized edge + VALVE_STATE_IDLE, ///< Valve state idle + VALVE_STATE_IN_TRANSITION, ///< Valve state in transition + NUM_OF_VALVE_STATES, ///< Number of valve exec states } VALVE_STATE_T; /// Valve status structure typedef struct { - 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 targetEncPosition; ///< Valve target 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 transitionStartTime; ///< 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 + 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 targetEncPosition; ///< Valve target 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 transitionStartTime; ///< 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 // Homing variables - U32 numberOfFailedHomings; ///< Valve number of failed homing - U32 homingEdgeDetectionCounter; ///< Valve homing counter when there is not much travel - BOOL hasHomingBeenRequested; ///< Valve homing request flag - BOOL hasValveBeenHomed; ///< Valve homing completed flag - BOOL hasHomingFailed; ///< Valve homing failed flag + U32 numberOfFailedHomings; ///< Valve number of failed homing + U32 homingEdgeDetectionCounter; ///< Valve homing counter when there is not much travel + BOOL hasHomingBeenRequested; ///< Valve homing request flag + BOOL hasValveBeenHomed; ///< Valve homing completed flag + BOOL hasHomingFailed; ///< Valve homing failed flag } VALVE_STATUS_T; /// Payload record structure for pinch valve set position request typedef struct { - U32 valve; ///< which pinch valve to set (0=VBA, 1=VBV) - U32 pos; ///< 1=A, 2=B, 3=C + U32 valve; ///< which pinch valve to set (0=VBA, 1=VBV) + U32 pos; ///< 1=A, 2=B, 3=C } VALVE_PINCH_SET_CMD_PAYLOAD_T; /// Payload record structure for pinch valve home request typedef struct { - U32 valve; ///< which pinch valve to home (0=VBA, 1=VBV) - BOOL force; ///< Flag indicates whether home should be forced to happen even if already homed. - BOOL tubing; ///< Flag indicates whether tubing will be present. + U32 valve; ///< which pinch valve to home (0=VBA, 1=VBV) + BOOL force; ///< Flag indicates whether home should be forced to happen even if already homed. + BOOL tubing; ///< Flag indicates whether tubing will be present. } VALVE_PINCH_HOME_CMD_PAYLOAD_T; // ********** private data ********** @@ -582,7 +582,7 @@ * @details \b Inputs: none * @details \b Outputs: valvesDataPublishInterval * @param message Override message from Dialin which includes the interval - * (in ms) to override the air pump broadcast interval to. + * (in ms) to override the valves broadcast interval to. * @return TRUE if override request is successful, FALSE if not *************************************************************************/ BOOL testValvesDataPublishIntervalOverride( MESSAGE_T *message )