Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r921034ee7092206a50183eacfaa73b436d2dee5f -ra07d9c4f115d1fed3c40c129edb5125d29070920 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 921034ee7092206a50183eacfaa73b436d2dee5f) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision a07d9c4f115d1fed3c40c129edb5125d29070920) @@ -22,7 +22,8 @@ #include "NVDataMgmt.h" #include "OperationModes.h" #include "PersistentAlarm.h" -#include "SystemCommMessages.h" +#include "SystemCommMessages.h" +#include "SelfTests.h" #include "TaskGeneral.h" #include "Temperatures.h" #include "Timers.h" @@ -69,6 +70,7 @@ #define PSI_TO_MMHG ( 51.7149F ) ///< Conversion factor for converting PSI to mmHg. +// The new arterial pressure sensor is the same as the venous pressure sensor #define VENOUS_PRESSURE_NORMAL_OP 0 ///< Venous pressure status bits indicate normal operation. #define VENOUS_PRESSURE_CMD_MODE 1 ///< Venous pressure status bits indicate sensor in command mode. #define VENOUS_PRESSURE_STALE_DATA 2 ///< Venous pressure status bits indicate data is stale (no new data since last fpga read). @@ -659,7 +661,7 @@ static void checkOcclusions( void ) { U32 bpOccl = getMeasuredBloodPumpOcclusion(); - BOOL outOfRange = ( bpOccl < MIN_OCCLUSION_COUNTS || bpOccl > MAX_OCCLUSION_COUNTS ? TRUE : FALSE ); + BOOL outOfRange = ( bpOccl < MIN_OCCLUSION_COUNTS || bpOccl > MAX_OCCLUSION_COUNTS ? TRUE : FALSE ); #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PRESSURE_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) @@ -671,14 +673,37 @@ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_BP_OCCLUSION_OUT_OF_RANGE, bpOccl ); } - // Check for occlusion - if ( bpOccl > ( OCCLUSION_THRESHOLD_OFFSET + bloodPumpOcclusionAfterCartridgeInstall ) ) + // Check for occlusion in PreTreatment modes when the cartridge is installed + // and setOcclusionInstallLevel has been called. + if( MODE_PRET == getCurrentOperationMode() ) { - signalBloodPumpHardStop(); // Stop pump immediately - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_OCCLUSION_BLOOD_PUMP, bpOccl ) + if( getPreTreatmentSubState() > HD_PRE_TREATMENT_CART_INSTALL_STATE && getDrySelfTestsState() > DRY_SELF_TESTS_START_STATE ) + { + // Check for occlusion + if ( bpOccl > ( OCCLUSION_THRESHOLD_OFFSET + bloodPumpOcclusionAfterCartridgeInstall ) ) + { + signalBloodPumpHardStop(); // Stop pump immediately + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_OCCLUSION_BLOOD_PUMP, bpOccl ) + } + } } - else + // Check for occlusion in PreTreatment modes where pumps are moving + else if( MODE_TREA == getCurrentOperationMode() ) { + if( TREATMENT_STOP_STATE != getTreatmentState()) + { + // Check for occlusion + if ( bpOccl > ( OCCLUSION_THRESHOLD_OFFSET + bloodPumpOcclusionAfterCartridgeInstall ) ) + { + signalBloodPumpHardStop(); // Stop pump immediately + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_OCCLUSION_BLOOD_PUMP, bpOccl ) + } + } + } + + // Clear alarm regardless of op mode once conditions are met. + if ( bpOccl <= ( OCCLUSION_CLEAR_THRESHOLD_OFFSET + bloodPumpOcclusionAfterCartridgeInstall ) ) + { clearAlarmCondition( ALARM_ID_OCCLUSION_BLOOD_PUMP ); } } Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -refb6fa9d4d14c9eb37985516746adf21563c3be5 -ra07d9c4f115d1fed3c40c129edb5125d29070920 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision efb6fa9d4d14c9eb37985516746adf21563c3be5) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision a07d9c4f115d1fed3c40c129edb5125d29070920) @@ -92,6 +92,7 @@ /// Expected position of empty in relation to home position. #define SYRINGE_PUMP_EMPTY_POS ( SYRINGE_ENCODER_COUNTS_PER_ML * 10.84F ) + /// Margin of error for empty position determination. #define SYRINGE_PUMP_EMPTY_POS_MARGIN ( SYRINGE_ENCODER_COUNTS_PER_ML * 0.5F ) /// Minimum retract position. @@ -1985,6 +1986,7 @@ + /*********************************************************************//** * @brief * The testSetSyringePumpDataPublishIntervalOverride function overrides the Index: firmware/App/HDCommon.h =================================================================== diff -u -r254faac62b851c393c5df753eade2dc880b83247 -ra07d9c4f115d1fed3c40c129edb5125d29070920 --- firmware/App/HDCommon.h (.../HDCommon.h) (revision 254faac62b851c393c5df753eade2dc880b83247) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision a07d9c4f115d1fed3c40c129edb5125d29070920) @@ -10,8 +10,8 @@ * @author (last) Dara Navaei * @date (last) 23-May-2022 * -* @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 46 +#define HD_VERSION_BUILD 301 // ********** development build switches ********** @@ -43,13 +43,15 @@ // #define DISABLE_FPGA_COUNTER_CHECKS 1 // Disable alarms associated with FPGA read/error counters // #define EMC_TEST_BUILD 1 // EMC test build - HD/DG run separately but connected, HD pumps toggle on/off w/ stop button #define DISABLE_WD_AND_SFTY_POST_TESTS 1 // Disable watchdog and safety shutdown POST tests - #define DISABLE_UI_POST_TEST 1 // Disable the UI POST -// #define PBA_ESTIMATION 1 // Estimate arterial pressure rather than look at PBA sensor // Part of DVT build switch +// #define DISABLE_UI_POST_TEST 1 // Disable the UI POST + #define PBA_ESTIMATION 1 // Estimate arterial pressure rather than look at PBA sensor // Part of DVT build switch // TODO stays as a build switch until the calibration structure is updated with the build - #define SKIP_CAL_CHECK 1 // Implement software configuration + #define SKIP_CAL_CHECK 1 // Implement software configuration once the build switch is done - #include + #define DISABLE_UI_POST_TEST + +#include #include #endif #endif Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r4ec54dc76acf9a434fb860c51739a7dd6f72afd6 -ra07d9c4f115d1fed3c40c129edb5125d29070920 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 4ec54dc76acf9a434fb860c51739a7dd6f72afd6) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision a07d9c4f115d1fed3c40c129edb5125d29070920) @@ -527,6 +527,7 @@ *************************************************************************/ static SELF_TEST_STATUS_T execUITest( void ) { + #ifndef DISABLE_UI_POST_TEST SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; @@ -554,6 +555,7 @@ #endif return result; + } /**@}*/ Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -r49a4a92ec05c597a88704d8177c30ff0f026602b -ra07d9c4f115d1fed3c40c129edb5125d29070920 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 49a4a92ec05c597a88704d8177c30ff0f026602b) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision a07d9c4f115d1fed3c40c129edb5125d29070920) @@ -41,7 +41,7 @@ #define PUMP_RUN_SELF_TEST_TIME_MS ( 15 * MS_PER_SECOND ) ///< Self-test time to run pumps in ms. #define PUMP_SELF_TEST_FLOW_RATE_ML_MIN 100 ///< Self-test pump flow rate in mL/min. -#define SYRINGE_PUMP_OCCLUSION_CHECK_DELAY ( 3 * MS_PER_SECOND ) ///< Delay 3 seconds then check for syringe pump prime occlusion. +#define SYRINGE_PUMP_OCCLUSION_CHECK_DELAY ( 1 * MS_PER_SECOND ) ///< Delay 3 seconds then check for syringe pump prime occlusion. #define BLOOD_PUMP_RUN_TIME_PRESSURE_SELF_TEST ( 5 * MS_PER_SECOND ) ///< Pressure self-test time to run blood pump in ms. #define NORMALIZED_PRESSURE_SELF_TEST_TIME ( 4 * MS_PER_SECOND ) ///< Time to wait for pressure to normalize in ms. @@ -326,7 +326,7 @@ } else { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_NO_CART_SELF_TEST_TIMEOUT, currentNoCartSelfTestsState ); +// SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_NO_CART_SELF_TEST_TIMEOUT, currentNoCartSelfTestsState ); } } } @@ -884,10 +884,10 @@ { state = DRY_SELF_TESTS_OCCLUSION_SENSORS_STATE; } - else - { - activateAlarmNoData( ALARM_ID_INSTALL_NEW_CARTRIDGE ); - } +// else +// { +// activateAlarmNoData( ALARM_ID_INSTALL_NEW_CARTRIDGE ); +// } if ( TRUE == doesAlarmStatusIndicateStop() ) { @@ -1030,8 +1030,8 @@ { if ( TRUE == isSyringePumpPrimed() ) { + syringeOcclusionDelayStartTime = getMSTimerCount(); // Get the current time to check for occlusion after 1 second has elapsed state = DRY_SELF_TESTS_SYRINGE_PUMP_OCCLUSION_DETECTION_STATE; - syringeOcclusionDelayStartTime = getMSTimerCount(); // Get the current time to check for occlusion after 3 seconds has elapsed } else { Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r1519b5d150fd913f596715f0eacce7d5c5e0d56c -ra07d9c4f115d1fed3c40c129edb5125d29070920 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 1519b5d150fd913f596715f0eacce7d5c5e0d56c) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision a07d9c4f115d1fed3c40c129edb5125d29070920) @@ -52,8 +52,7 @@ #define MAX_COMM_CRC_FAILURE_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< CRC error window #define MSG_NOT_ACKED_TIMEOUT_MS 150 ///< Maximum time for a Denali message that requires ACK to be ACK'd - -#define MSG_NOT_ACKED_TIMEOUT_MS_INIT 5000 ///< Maximum time for a Denali message that requires ACK to be ACK'd on the INIT state for the first (UI version request) message of the POST +#define MSG_NOT_ACKED_TIMEOUT_MS_INIT 5000 ///< Maximum time for a Denali message that requires ACK to be ACK'd on the INIT state for the first (UI version request) message of the POST #define MSG_NOT_ACKED_MAX_RETRIES 3 ///< Maximum number of times a message that requires ACK that was not ACK'd can be re-sent before alarm #define PENDING_ACK_LIST_SIZE 25 ///< Maximum number of Denali messages that can be pending ACK at any given time @@ -1619,10 +1618,6 @@ handleTestSyringePumpHeprinBolusTargetRateOverrideRequest( message ); break; - case MSG_ID_HD_REQ_CURRENT_TREATMENT_PARAMETERS: - handleTestCurrentTreamtmentParametersRequest( message ); - break; - case MSG_ID_HD_FANS_DUTY_CYCLE_OVERRIDE: handleSetFansDutyCycleOverrideRequest( message ); break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r4ec54dc76acf9a434fb860c51739a7dd6f72afd6 -ra07d9c4f115d1fed3c40c129edb5125d29070920 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 4ec54dc76acf9a434fb860c51739a7dd6f72afd6) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision a07d9c4f115d1fed3c40c129edb5125d29070920) @@ -28,6 +28,7 @@ #include "Fans.h" #include "FPGA.h" #include "ModeStandby.h" +#include "ModeInitPOST.h" #include "OperationModes.h" #include "RTC.h" #include "SampleWater.h" @@ -2359,13 +2360,13 @@ { TEMPERATURE_SENSORS_DATA_T payload; - memcpy( &payload, message->payload, sizeof( TEMPERATURE_SENSORS_DATA_T ) ); - setDialysateTemperatureReadings( payload.inletDialysate, payload.outletRedundant ); - } - // TODO - what to do if invalid payload length? - // TODO - how to know if DG stops sending these? -} - + memcpy( &payload, message->payload, sizeof( TEMPERATURE_SENSORS_DATA_T ) ); + setDialysateTemperatureReadings( payload.TDi, payload.TRo ); + } + // TODO - what to do if invalid payload length? + // TODO - how to know if DG stops sending these? +} + /*********************************************************************//** * @brief * The handleDialysateFlowData function handles dialysate flow data broadcast @@ -5187,6 +5188,7 @@ if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) { memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) { result = testSetBatteryRemainingPercentOverride( payload.state.u32 );