Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r891cb02e17aa6c3a5457c2bcce277180ab21d9d0 -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 891cb02e17aa6c3a5457c2bcce277180ab21d9d0) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -7,8 +7,8 @@ * * @file BloodFlow.c * -* @author (last) Dara Navaei -* @date (last) 26-Jul-2023 +* @author (last) Sean Nash +* @date (last) 17-Jul-2023 * * @author (original) Sean Nash * @date (original) 07-Nov-2019 Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r1281328075355359a89df86bb3f31a2e2e580b8b -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 1281328075355359a89df86bb3f31a2e2e580b8b) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -226,7 +226,7 @@ *************************************************************************/ void execDGInterfaceMonitor( void ) { - if ( isACPowerLost() != TRUE ) + if ( FALSE == isACPowerLost() ) { // Trigger alarm if not receiving new load cell data message in timely manner checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); @@ -458,14 +458,14 @@ /*********************************************************************//** * @brief - * The getDialysateTemperature function gets the latest dialysate temperature. - * @details Inputs: dgDialysateTemp + * The getDGDisinfectsStates function returns the DG disinfects readings. + * @details Inputs: none * @details Outputs: none - * @return the latest dialysate temperature + * @return the current DG disinfects readings *************************************************************************/ -F32 getDialysateTemperature( void ) +DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) { - return dgDialysateTemp; + return disinfectsStatus; } /*********************************************************************//** @@ -509,14 +509,14 @@ /*********************************************************************//** * @brief - * The getDGDisinfectsStates function returns the DG disinfects readings. - * @details Inputs: none + * The getDialysateTemperature function returns the DG dialysate temperature. + * @details Inputs: dgDialysateTemp * @details Outputs: none - * @return the current DG disinfects readings + * @return the latest dialysate temperature *************************************************************************/ -DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) +F32 getDialysateTemperature( void ) { - return disinfectsStatus; + return dgDialysateTemp; } /*********************************************************************//** @@ -1310,7 +1310,7 @@ U32 trimmerState = dgHeatersData.trimmerHeaterState; DG_OP_MODE_T dgOp = getDGOpMode(); - if ( isACPowerLost() != TRUE ) + if ( FALSE == isACPowerLost() ) { if ( ( DG_MODE_GENE == dgOp ) || ( DG_MODE_FILL == dgOp ) || ( DG_MODE_DRAI == dgOp ) ) { Index: firmware/App/Controllers/DGInterface.h =================================================================== diff -u -r1281328075355359a89df86bb3f31a2e2e580b8b -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision 1281328075355359a89df86bb3f31a2e2e580b8b) +++ firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -122,6 +122,7 @@ F32 getHeatDisinfectTemperatureSensorValue( void ); BOOL getTrimmerHeaterCommandedOn( void ); DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ); +F32 getDialysateTemperature( void ); DG_MIXING_RATIOS_T getDGMixingRatios( void ); void getHDVersionDGServiceAndUsageData( DG_SERVICE_AND_USAGE_DATA_T* data ); Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r891cb02e17aa6c3a5457c2bcce277180ab21d9d0 -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 891cb02e17aa6c3a5457c2bcce277180ab21d9d0) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -161,10 +161,12 @@ #define SYRINGE_PUMP_STALL_SPEED_THRESHOLD 0.05F ///< Minimum syringe pump speed to be considered not stalled. #define SYRINGE_PUMP_ADC_FPGA_ERROR_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Syringe pump ADC FPGA error timeout in milliseconds. + #define SYRINGE_PUMP_DAC_MAX_RETRIES 5 ///< Syringe pump DAC retries to write. #define SYRINGE_PUMP_DAC_TIMER ( 200 / TASK_PRIORITY_INTERVAL ) ///< Syringe pump DAC timer between retries. #define SYRINGE_PUMP_OCCLUSION_PERSISTENCE 50 ///< Syringe pump occlusion persistence timer in milliseconds. #define SYRINGE_PUMP_EMPTY_FORCE_COUNT 5 ///< Syringe pump empty force voltage count persistence. + /// Defined states for the syringe pump control state machine. typedef enum SyringePump_States { @@ -338,6 +340,7 @@ initPersistentAlarm( ALARM_ID_HD_SYRINGE_PUMP_CONTROLLER_DIRECTION_ERROR, 0, SYRINGE_PUMP_DIR_ALARM_PERSISTENCE ); initPersistentAlarm( ALARM_ID_HD_SYRINGE_PUMP_RUNNING_WHILE_BP_OFF_ERROR, 0, SYRINGE_PUMP_OFF_ALARM_PERSISTENCE ); initPersistentAlarm( ALARM_ID_HD_SYRINGE_PUMP_SPEED_ERROR, 0, SYRINGE_PUMP_RATE_ALARM_PERSISTENCE ); + initPersistentAlarm( ALARM_ID_HD_SYRINGE_PUMP_OCCLUSION, 0, SYRINGE_PUMP_OCCLUSION_PERSISTENCE); initTimeWindowedCount( TIME_WINDOWED_COUNT_SYRINGE_PUMP_OFF_ERROR, SYRINGE_PUMP_OFF_ERROR_MAX_CNT, SYRINGE_PUMP_OFF_ERROR_TIME_WIN_MS ); initFPGAPersistentAlarm( FPGA_PERS_ERROR_SYRINGE_PUMP_ADC, ALARM_ID_HD_SYRINGE_PUMP_FPGA_ADC_FAULT, Index: firmware/App/Controllers/Temperatures.c =================================================================== diff -u -r891cb02e17aa6c3a5457c2bcce277180ab21d9d0 -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/Controllers/Temperatures.c (.../Temperatures.c) (revision 891cb02e17aa6c3a5457c2bcce277180ab21d9d0) +++ firmware/App/Controllers/Temperatures.c (.../Temperatures.c) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -289,9 +289,10 @@ if ( ( temperature > MAX_ALLOWED_TEMPERATURE ) || ( temperature < MIN_ALLOWED_TEMPERATURE ) ) { - isTempOutOfRange |= TRUE; - lastFaultSensor = sensor; + isTempOutOfRange = TRUE; + lastFaultSensor = sensor; } + } checkPersistentAlarm( ALARM_ID_HD_TEMPERATURES_OUT_OF_RANGE, isTempOutOfRange, lastFaultSensor, MAX_ALLOWED_TEMPERATURE ); Index: firmware/App/HDCommon.h =================================================================== diff -u -r891cb02e17aa6c3a5457c2bcce277180ab21d9d0 -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/HDCommon.h (.../HDCommon.h) (revision 891cb02e17aa6c3a5457c2bcce277180ab21d9d0) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -10,8 +10,8 @@ * @author (last) Dara Navaei * @date (last) 21-Jul-2023 * -* @author (original) Sean -* @date (original) 27-Feb-2020 +* @author (original) Sean +* @date (original) 27-Feb-2020 * ***************************************************************************/ @@ -25,7 +25,7 @@ #define HD_VERSION_MAJOR 0 #define HD_VERSION_MINOR 6 #define HD_VERSION_MICRO 0 -#define HD_VERSION_BUILD 209 +#define HD_VERSION_BUILD 686 // ********** development build switches ********** Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -re3a7845d627546912ff9323da25a4e67b0eaeffc -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision e3a7845d627546912ff9323da25a4e67b0eaeffc) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -254,6 +254,33 @@ /*********************************************************************//** * @brief + * The isACPowerLost function determines whether A/C power loss has + * been detected. This function sets the alarms blocked condition to + * allow smooth alarm recovery. + * + * @details Inputs: alarmStatus + * @details Outputs: alarmsBlockedTimer + * @return TRUE if A/C power loss alarm is in effect, FALSE if not + *************************************************************************/ +BOOL isACPowerLost( void ) +{ + BOOL result = TRUE; + + // Continue to block new alarms until the alarms are cleared. + if ( ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST ) ) && + ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST_IN_TREATMENT ) ) ) + { + result = FALSE; + } + else + { + alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; + } + return result; +} + +/*********************************************************************//** + * @brief * The activateAlarm function activates a given alarm. * @details Inputs: none * @details Outputs: alarmIsActive[], alarmStartedAt[], alarmStatus is updated @@ -262,6 +289,11 @@ *************************************************************************/ static void activateAlarm( ALARM_ID_T alarm ) { + // Block new alarms, occuring during loss of AC power + if ( ( TRUE == getCPLDACPowerLossDetected() ) ) + { + alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; + } // Verify valid alarm index if ( ( alarm > ALARM_ID_NO_ALARM ) && ( alarm < NUM_OF_ALARM_IDS ) ) { @@ -358,12 +390,7 @@ * @return none *************************************************************************/ void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2 ) -{ - // Block if new alarms are occur during loss of AC power - if ( ( TRUE == getCPLDACPowerLossDetected() ) ) - { - alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; - } +{ // Sanity check, verify valid alarm index if ( ( alarm > ALARM_ID_NO_ALARM ) && ( alarm < NUM_OF_ALARM_IDS ) ) { Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r1281328075355359a89df86bb3f31a2e2e580b8b -r2e6fa609bde16c6e335cbea127ecfa7a6afad6c9 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 1281328075355359a89df86bb3f31a2e2e580b8b) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2e6fa609bde16c6e335cbea127ecfa7a6afad6c9) @@ -5451,6 +5451,7 @@ if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) { memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) { result = testSetBatteryRemainingCapacityOverride( payload.state.f32 );