Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r31b6217a4c71b824a9ed25236efe4adcfeab7986 -ra56db4650fe5652d633e0c51b29da32d5d708608 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 31b6217a4c71b824a9ed25236efe4adcfeab7986) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision a56db4650fe5652d633e0c51b29da32d5d708608) @@ -8,7 +8,7 @@ * @file BloodFlow.c * * @author (last) Sean Nash -* @date (last) 17-Jul-2023 +* @date (last) 10-Aug-2023 * * @author (original) Sean Nash * @date (original) 07-Nov-2019 @@ -22,8 +22,8 @@ #include "gio.h" #include "reg_het.h" -#include "Battery.h" #include "BloodFlow.h" +#include "CPLD.h" #include "FPGA.h" #include "InternalADC.h" #include "NVDataMgmt.h" @@ -128,9 +128,9 @@ #define BP_COMMUTATION_ERROR_MAX_CNT 3 ///< Maximum number of commutation errors within time window before alarm triggered. #define BP_COMMUTATION_ERROR_TIME_WIN_MS (15 * MS_PER_SECOND) ///< Time window for BP commutation error. -#define BP_FLOW_ALPHA_Y_INTERCEPT 1.0550F ///< Y intercept used for alpha flow coefficient calculation. +#define BP_FLOW_ALPHA_Y_INTERCEPT 1.11F ///< Y intercept used for alpha flow coefficient calculation. #define BP_FLOW_WEAR_A_TERM 0.00000000896F ///< A term used for wear portion of alpha flow coefficient. -#define BP_FLOW_WEAR_B_TERM 0.000298F ///< B term used for wear portion of alpha flow coefficient. +#define BP_FLOW_WEAR_B_TERM 0.000550F ///< B term used for wear portion of alpha flow coefficient. #define BP_MAX_ROTOR_COUNT_FOR_WEAR 25000 ///< Maximum rotor count for determining wear of the cartridge (negligible affect beyond this threshold). #define DATA_PUBLISH_COUNTER_START_COUNT 20 ///< Data publish counter start count. @@ -1261,7 +1261,7 @@ BOOL const isRunningMCCurrentBad = ( ( BLOOD_PUMP_OFF_STATE != bloodPumpState ) && ( bpCurr > BP_MAX_CURR_WHEN_RUNNING_MA ) ? TRUE : FALSE ); if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_BLOOD_PUMP_MC_CURRENT_CHECK, isOffMCCurrentBad || isRunningMCCurrentBad ) ) && - ( FALSE == isACPowerLost() ) ) + ( getCPLDACPowerLossDetected() != TRUE ) ) { #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_MOTOR_CURRNT_CHECKS ) != SW_CONFIG_ENABLE_VALUE )