Index: firmware/App/Drivers/PeristalticPump.c =================================================================== diff -u -r18783d138aec872e3f5b73e60e14e3c53bf740ec -reffc2a8283d6528109b2401bbad70dc554db4e53 --- firmware/App/Drivers/PeristalticPump.c (.../PeristalticPump.c) (revision 18783d138aec872e3f5b73e60e14e3c53bf740ec) +++ firmware/App/Drivers/PeristalticPump.c (.../PeristalticPump.c) (revision effc2a8283d6528109b2401bbad70dc554db4e53) @@ -28,15 +28,15 @@ // ********** private definitions ********** #define MAX_PUMP_SPEED_RPM 3080U ///< Maximum speed (in RPM) that a peristaltic pump can be set to. -#define BP_PUMP_CMD_GAIN 0.9F ///< Gain for blood pump commanded RPM that must be applied before sending to FPGA. -#define BP_PUMP_CMD_OFFSET 80.0F ///< Offset for blood pump commanded RPM that must be applied before sending to FPGA. -#define BP_PUMP_CMD_CAL(r) ((r) * BP_PUMP_CMD_GAIN + BP_PUMP_CMD_OFFSET ) ///< Macro to calibrate a commanded blood pump RPM before sending to FPGA. +#define H4_PUMP_CMD_GAIN 0.9F ///< Gain for blood pump commanded RPM that must be applied before sending to FPGA. +#define H4_PUMP_CMD_OFFSET 80.0F ///< Offset for blood pump commanded RPM that must be applied before sending to FPGA. +#define H4_PUMP_CMD_CAL(r) ((r) * H4_PUMP_CMD_GAIN + H4_PUMP_CMD_OFFSET ) ///< Macro to calibrate a commanded blood pump RPM before sending to FPGA. -#define BP_PERIOD_SEC 0.00001F ///< Blood pump feedback period in seconds. -#define BP_HZ_TO_RPM_SCALAR 10.0F ///< Blood pump Hz to RPM scalar. -#define BP_PERIOD_TO_HZ(p) ( 1.0F / (F32)((S32)(p) * BP_PERIOD_SEC) ) ///< Blood pump period to Hz conversion macro. -#define BP_HZ_TO_RPM(h) ((h) * BP_HZ_TO_RPM_SCALAR) ///< Blood pump Hz to RPM conversion macro. -#define BP_ZERO_SPEED_PERIOD 0xFFFF ///< Blood pump period reported when pump is stopped. +#define H4_PERIOD_SEC 0.00001F ///< Blood pump feedback period in seconds. +#define H4_HZ_TO_RPM_SCALAR 10.0F ///< Blood pump Hz to RPM scalar. +#define H4_PERIOD_TO_HZ(p) ( 1.0F / (F32)((S32)(p) * H4_PERIOD_SEC) ) ///< Blood pump period to Hz conversion macro. +#define H4_HZ_TO_RPM(h) ((h) * H4_HZ_TO_RPM_SCALAR) ///< Blood pump Hz to RPM conversion macro. +#define H4_ZERO_SPEED_PERIOD 0xFFFF ///< Blood pump period reported when pump is stopped. // ********** private data ********** @@ -63,10 +63,10 @@ pumpMeasSpeedRPM.ovInitData = 0.0F; pumpMeasSpeedRPM.override = OVERRIDE_RESET; - setBPDirection( MOTOR_DIR_FORWARD ); - resetBPHomeRequest(); - setBPSetSpeed( 0 ); - setBPEnabled( TRUE ); + setH4Direction( MOTOR_DIR_FORWARD ); + resetH4HomeRequest(); + setH4SetSpeed( 0 ); + setH4Enabled( TRUE ); } /*********************************************************************//** @@ -81,12 +81,12 @@ *************************************************************************/ void readPeristalticPumps( void ) { - U16 period = getBPPeriod(); - F32 Hz = BP_PERIOD_TO_HZ(period); - F32 rpm = BP_HZ_TO_RPM(Hz); + U16 period = getH4Period(); + F32 Hz = H4_PERIOD_TO_HZ(period); + F32 rpm = H4_HZ_TO_RPM(Hz); // update measured pump speed - if ( period != BP_ZERO_SPEED_PERIOD ) + if ( period != H4_ZERO_SPEED_PERIOD ) { if ( pumpSetSpeedRPM < 0 ) // TODO - can we get a real measured direction to base measured speed sign on? { @@ -106,7 +106,7 @@ if ( TRUE == pumpHomeRequested ) { pumpHomeRequested = FALSE; - resetBPHomeRequest(); + resetH4HomeRequest(); } } @@ -120,7 +120,7 @@ void cmdPeristalticPumpHome( void ) { pumpHomeRequested = TRUE; - homeBP(); + homeH4(); } /*********************************************************************//** @@ -140,7 +140,7 @@ if ( abs( rpm ) < MAX_PUMP_SPEED_RPM ) { - F32 calRpm = BP_PUMP_CMD_CAL( (F32)rpm ); + F32 calRpm = H4_PUMP_CMD_CAL( (F32)rpm ); U16 setRpm = (U16)( abs( (S32)calRpm ) ); MOTOR_DIR_T dir = MOTOR_DIR_FORWARD; @@ -149,8 +149,8 @@ dir = MOTOR_DIR_REVERSE; } pumpSetSpeedRPM = rpm; - setBPDirection( dir ); - setBPSetSpeed( setRpm ); + setH4Direction( dir ); + setH4SetSpeed( setRpm ); result = TRUE; } else