Index: firmware/App/Drivers/PeristalticPump.c =================================================================== diff -u -raa6d45143096dfab776ce2ed7c775cfe2dd6db18 -rae3240cfb3237c01472168fee0bfc6beb34e0ed9 --- firmware/App/Drivers/PeristalticPump.c (.../PeristalticPump.c) (revision aa6d45143096dfab776ce2ed7c775cfe2dd6db18) +++ firmware/App/Drivers/PeristalticPump.c (.../PeristalticPump.c) (revision ae3240cfb3237c01472168fee0bfc6beb34e0ed9) @@ -43,8 +43,6 @@ #define H4_ROT_PERIOD_TO_HZ(p) ( 1.0F / (F32)((S32)(p) * H4_ROT_PERIOD_SEC) ) ///< Blood pump rotor period to Hz conversion macro. #define H4_ROT_PERIOD_TO_RPM(p) ((H4_ROT_PERIOD_TO_HZ(p)) * (F32)SEC_PER_MIN) ///< Blood pump rotor period to RPM conversion macro. -#define H4_HOME_SPEED_RPM 400 ///< Blood pump set speed for rotor homing operation. - #define H6_STATUS_HOME_BIT_POS 0x1 ///< Bit position in H6 status register that indicates whether rotor is in home position. // ********** private data ********** @@ -153,6 +151,18 @@ /*********************************************************************//** * @brief + * The cancelPeristalticPumpHome function cancels a pump home operation. + * @details \b Inputs: none + * @details \b Outputs: pumpHomeInProgress + * @return none + *************************************************************************/ +void cancelPeristalticPumpHome( void ) +{ + pumpHomeInProgress = FALSE; +} + +/*********************************************************************//** + * @brief * The isPeristalticPumpHome function determines whether the rotor is currently * in the home position. * @details \b Inputs: FPGA @@ -161,14 +171,27 @@ *************************************************************************/ BOOL isPeristalticPumpHome( void ) { - U08 status = getH6Status() & H6_STATUS_HOME_BIT_POS; - BOOL result = ( status != 0 ? TRUE : FALSE ); + U08 status = getH6RotorStatus() & H6_STATUS_HOME_BIT_POS; + BOOL result = ( status != 0 ? FALSE : TRUE ); return result; } /*********************************************************************//** * @brief + * The isPumpHomeInProgress function determines whether a home operation is + * currently in progress. + * @details \b Inputs: pumpHomeInProgress + * @details \b Outputs: none + * @return pumpHomeInProgress + *************************************************************************/ +BOOL isPumpHomeInProgress( void ) +{ + return pumpHomeInProgress; +} + +/*********************************************************************//** + * @brief * The setPeristalticPumpSetSpeed function sets the target pump speed (in RPM). * @note A negative set speed indicates reverse (CCW) direction. * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if given set speed is out