Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r87d705fcf977af12b7b034735fa5867f2daea2b9 -rb692af0986725e87431ca5e23c5721f1b242baac --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 87d705fcf977af12b7b034735fa5867f2daea2b9) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision b692af0986725e87431ca5e23c5721f1b242baac) @@ -398,7 +398,7 @@ currentValveStates[ valve ].hasValveBeenHomed = FALSE; currentValveStates[ valve ].hasHomingFailed = TRUE; currentValveStates[ valve ].hasHomingBeenRequested = FALSE; - // TODO SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_VALVE_HOMING_FAILED, (U32)valve, (U32)edgeDelta ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_VALVE_HOMING_FAILED, (U32)valve, (U32)edgeDelta ); } nextState = VALVE_STATE_HOMING_NOT_STARTED; } @@ -495,7 +495,7 @@ // Go back to Idle state and set the valve position to not in position because it was not able to get to the target position currentValveStates[ valve ].currentPosition = VALVE_POSITION_NOT_IN_POSITION; nextState = VALVE_STATE_IDLE; - // TODO SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_VALVE_TRANSITION_TIMEOUT, (U32)valve ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_VALVE_TRANSITION_TIMEOUT, (U32)valve ); // If the valve's commanded position is C, activate safety shutdown if ( VALVE_POSITION_C_CLOSE == currentValveStates[ valve ].commandedPosition ) Index: firmware/App/Drivers/RotaryValve.c =================================================================== diff -u -r87d705fcf977af12b7b034735fa5867f2daea2b9 -rb692af0986725e87431ca5e23c5721f1b242baac --- firmware/App/Drivers/RotaryValve.c (.../RotaryValve.c) (revision 87d705fcf977af12b7b034735fa5867f2daea2b9) +++ firmware/App/Drivers/RotaryValve.c (.../RotaryValve.c) (revision b692af0986725e87431ca5e23c5721f1b242baac) @@ -27,11 +27,11 @@ // ********** private definitions ********** -#define VALVE_ENC_COUNT_2_MICRO_STEP_CONVERSION 6.25F ///< 6.25 microsteps per encoder count. +#define VALVE_ENC_COUNT_2_MICRO_STEP_CONVERSION 6.25F ///< 6.25 microsteps per encoder count. -#define VALVE_MOTOR_DRIVER_FAULT_BIT_MASK 0x1 ///< Bit mask for valve motor driver fault. -#define VALVE_DIRECTION_FAULT_BIT_MASK 0x2 ///< Bit mask for valve direction fault. -#define VALVE_INCORRECT_ENCODER_STATUS_BIT_MASK 0x4 ///< Bit mask for valve incorrect encoder sensor fault. +#define VALVE_MOTOR_DRIVER_FAULT_BIT_MASK 0x1 ///< Bit mask for valve motor driver fault. +#define VALVE_DIRECTION_FAULT_BIT_MASK 0x2 ///< Bit mask for valve direction fault. +#define VALVE_INCORRECT_ENCODER_STATUS_BIT_MASK 0x4 ///< Bit mask for valve incorrect encoder sensor fault. /// Bit mask for all (OR'd) valve faults. #define VALVE_GEN_FAULT_BIT_MASK ( VALVE_MOTOR_DRIVER_FAULT_BIT_MASK | VALVE_DIRECTION_FAULT_BIT_MASK | VALVE_INCORRECT_ENCODER_STATUS_BIT_MASK ) @@ -40,17 +40,17 @@ /// Payload record structure for rotary valve set position request typedef struct { - U32 valve; ///< which rotary valve to set position for (0=VBA, 1=VBV) - S16 stepChange; ///< number of steps to change position (pos indicates CW, neg indicates CCW) + U32 valve; ///< which rotary valve to set position for (0=VBA, 1=VBV) + S16 stepChange; ///< number of steps to change position (pos indicates CW, neg indicates CCW) } VALVE_ROTARY_SET_CMD_PAYLOAD_T; #pragma pack(pop) // ********** private data ********** -static U08 valveControl[ NUM_OF_VALVES ]; ///< Current control bits for each valve. -static OVERRIDE_U32_T valveStatus[ NUM_OF_VALVES ]; ///< Current status bits for each valve. -static S16 commandValvePosChange[ NUM_OF_VALVES ]; ///< Current commanded valve position changes. Negative indicates CCW direction. -static OVERRIDE_S32_T currentValveEncPosition[ NUM_OF_VALVES ]; ///< Current encoder valve positions (overrideable). Negative indicates CCW direction. +static U08 valveControl[ NUM_OF_VALVES ]; ///< Current control bits for each valve. +static OVERRIDE_U32_T valveStatus[ NUM_OF_VALVES ]; ///< Current status bits for each valve. +static S16 commandValvePosChange[ NUM_OF_VALVES ]; ///< Current commanded valve position changes. Negative indicates CCW direction. +static OVERRIDE_S32_T currentValveEncPosition[ NUM_OF_VALVES ]; ///< Current encoder valve positions (overrideable). Negative indicates CCW direction. // ********** private function prototypes ********** Index: firmware/App/Drivers/Valve2Way.c =================================================================== diff -u -r87d705fcf977af12b7b034735fa5867f2daea2b9 -rb692af0986725e87431ca5e23c5721f1b242baac --- firmware/App/Drivers/Valve2Way.c (.../Valve2Way.c) (revision 87d705fcf977af12b7b034735fa5867f2daea2b9) +++ firmware/App/Drivers/Valve2Way.c (.../Valve2Way.c) (revision b692af0986725e87431ca5e23c5721f1b242baac) @@ -45,7 +45,7 @@ * @brief * The init2WayValves function initializes the 2-way valve driver unit. * @details \b Inputs: none - * @details \b Outputs: current2WayValveStates[] + * @details \b Outputs: 2-way valve driver unit initialized. * @return none *************************************************************************/ void init2WayValves(void) Index: firmware/App/Drivers/Valve2Way.h =================================================================== diff -u -rd9b5f588d81e15ed3849222bed3362e15dbf4b0a -rb692af0986725e87431ca5e23c5721f1b242baac --- firmware/App/Drivers/Valve2Way.h (.../Valve2Way.h) (revision d9b5f588d81e15ed3849222bed3362e15dbf4b0a) +++ firmware/App/Drivers/Valve2Way.h (.../Valve2Way.h) (revision b692af0986725e87431ca5e23c5721f1b242baac) @@ -25,7 +25,7 @@ /** * @defgroup Valve2Way Valve2Way * @brief 2 way valve driver unit. Provides low level functions - * to control a a 2 way valve. + * to control a 2 way valve. * * @addtogroup Valve2Way * @{ Index: firmware/App/Services/AlarmMgmtTD.c =================================================================== diff -u -rd9b5f588d81e15ed3849222bed3362e15dbf4b0a -rb692af0986725e87431ca5e23c5721f1b242baac --- firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision d9b5f588d81e15ed3849222bed3362e15dbf4b0a) +++ firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision b692af0986725e87431ca5e23c5721f1b242baac) @@ -1316,40 +1316,44 @@ BOOL result = FALSE; U32 key; - memcpy( &key, message->payload, sizeof(U32) ); - - // Verify key - if ( SUPERVISOR_ALARM_KEY == key ) + // Verify tester has logged in with TD + if ( TRUE == isTestingActivated() ) { - // Verify tester has logged in with HD - if ( TRUE == isTestingActivated() ) + // Verify payload length + if ( sizeof(U32) == message->hdr.payloadLen ) { - ALARM_ID_T a; + memcpy( &key, message->payload, sizeof(U32) ); - // clear the flags when Dialin clears alarms - resumeBlockedByAlarmProperty = FALSE; - - // Clear all active alarms - for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) + // Verify key + if ( SUPERVISOR_ALARM_KEY == key ) { - if ( TRUE == isAlarmActive( a ) ) - { - ALARM_T props = getAlarmProperties( a ); - ALARM_ID_DATA_PUBLISH_T data; + ALARM_ID_T a; - data.alarmID = (U32)a; + // clear the flags when Dialin clears alarms + resumeBlockedByAlarmProperty = FALSE; - broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_TD_ALARM, (U08*)&data, sizeof( ALARM_ID_DATA_PUBLISH_T ) ); - setAlarmActive( a , FALSE ); - alarmStartedAt[ a ].data = 0; - // Clear FIFO if this alarm was in it - if ( alarmPriorityFIFO[ props.alarmPriority ].alarmID == a ) + // Clear all active alarms + for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) + { + if ( TRUE == isAlarmActive( a ) ) { - resetAlarmPriorityFIFO( props.alarmPriority ); + ALARM_T props = getAlarmProperties( a ); + ALARM_ID_DATA_PUBLISH_T data; + + data.alarmID = (U32)a; + + broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_TD_ALARM, (U08*)&data, sizeof( ALARM_ID_DATA_PUBLISH_T ) ); + setAlarmActive( a , FALSE ); + alarmStartedAt[ a ].data = 0; + // Clear FIFO if this alarm was in it + if ( alarmPriorityFIFO[ props.alarmPriority ].alarmID == a ) + { + resetAlarmPriorityFIFO( props.alarmPriority ); + } } } + result = TRUE; } - result = TRUE; } }