Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -re2047250deeaec1353ae10e88b24bd4a533ed0a0 -rf702f87af0d8b7c1ecc7d9fb62d21989c34055ff --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision e2047250deeaec1353ae10e88b24bd4a533ed0a0) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision f702f87af0d8b7c1ecc7d9fb62d21989c34055ff) @@ -46,9 +46,9 @@ #define MIN_POWER_ON_TIME_FOR_COMM_FAILS ( 1 * MS_PER_SECOND ) ///< Allow FPGA comm errors for first second after power-up #define FPGA_H4_ENABLE_BIT_MASK 0x01 ///< Bit mask for enabling the blood pump. -#define FPGA_H4_DIR_FORWARD_BIT_MASK 0x02 ///< Bit mask for setting the blood pump direction. +#define FPGA_H4_DIRECTION_A_BIT_MASK 0x02 ///< Bit mask for setting the blood pump direction A setting. +#define FPGA_H4_DIRECTION_B_BIT_MASK 0x04 ///< Bit mask for setting the blood pump direction B setting. #define FPGA_H4_BRAKE_AND_HOLD_TORQUE 0x06 ///< Bit mask for braking the blood pump while holding the torque of the pump. -#define FPGA_H4_BIT_2_INDEX 2 ///< Blood pump bit 2 index. #define FPGA_H13_OPEN_BIT_MASK 0x01 ///< Bit mask for setting H13 valve position to open. #define FPGA_H20_OPEN_BIT_MASK 0x02 ///< Bit mask for setting H20 valve position to open. @@ -493,14 +493,15 @@ void setH4Direction( MOTOR_DIR_T dir ) { // This clears bit 2 for both forward and reverse directions - fpgaActuatorSetPoints.h4Control &= ~( 1 << FPGA_H4_BIT_2_INDEX ); if ( MOTOR_DIR_FORWARD == dir ) { - fpgaActuatorSetPoints.h4Control |= FPGA_H4_DIR_FORWARD_BIT_MASK; + fpgaActuatorSetPoints.h4Control &= ~FPGA_H4_DIRECTION_B_BIT_MASK; + fpgaActuatorSetPoints.h4Control |= FPGA_H4_DIRECTION_A_BIT_MASK; } else { - fpgaActuatorSetPoints.h4Control &= ~((U08)FPGA_H4_DIR_FORWARD_BIT_MASK); + fpgaActuatorSetPoints.h4Control |= FPGA_H4_DIRECTION_B_BIT_MASK; + fpgaActuatorSetPoints.h4Control &= ~((U08)FPGA_H4_DIRECTION_A_BIT_MASK); } }