Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r0a4dcd288d4347b85baaa0b07da568b6add5eac7 -r2f4f66fcceb986cc592693b08f1b57767cb1c515 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 0a4dcd288d4347b85baaa0b07da568b6add5eac7) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 2f4f66fcceb986cc592693b08f1b57767cb1c515) @@ -8,7 +8,7 @@ * @file BloodFlow.c * * @author (last) Sean Nash -* @date (last) 02-Jan-2023 +* @date (last) 18-Jan-2023 * * @author (original) Sean Nash * @date (original) 07-Nov-2019 @@ -19,7 +19,8 @@ #include "can.h" #include "etpwm.h" - + +#include "Battery.h" #include "BloodFlow.h" #include "FPGA.h" #include "InternalADC.h" @@ -538,14 +539,14 @@ void resetBloodPumpRotorCount( void ) { #ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_WORN_OUT_CARTRIDGE ) != SW_CONFIG_ENABLE_VALUE ) + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_WORN_OUT_CARTRIDGE ) ) { - bloodPumpRotorCounter.data = 0; + bloodPumpRotorCounter.data = BP_MAX_ROTOR_COUNT_FOR_WEAR; } else #endif { - bloodPumpRotorCounter.data = BP_MAX_ROTOR_COUNT_FOR_WEAR; + bloodPumpRotorCounter.data = 0; } } @@ -1248,7 +1249,7 @@ BOOL const isRunningMCCurrentBad = ( ( BLOOD_PUMP_OFF_STATE != bloodPumpState ) && ( bpCurr > BP_MAX_CURR_WHEN_RUNNING_MA ) ? TRUE : FALSE ); if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK, isOffMCCurrentBad || isRunningMCCurrentBad ) ) && - ( FALSE == isAlarmActive( ALARM_ID_HD_AC_POWER_LOST ) ) ) + ( FALSE == isACPowerLost() ) ) { #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_MOTOR_CURRNT_CHECKS ) != SW_CONFIG_ENABLE_VALUE )