Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r427b37ad929a8d88b5fcb9ae21a4f4146ffd2fef -r4031344a26897fb4adc74da2bdc3bd31d414b262 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 427b37ad929a8d88b5fcb9ae21a4f4146ffd2fef) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 4031344a26897fb4adc74da2bdc3bd31d414b262) @@ -37,18 +37,18 @@ // ********** private definitions ********** -#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. -#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. +#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. +#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. -#define SIZE_OF_LARGE_LOAD_CELL_AVG 32 ///< Large load cell moving average has 32 samples. +#define SIZE_OF_LARGE_LOAD_CELL_AVG 32 ///< Large load cell moving average has 32 samples. -#define DIALYSATE_TEMP_OUT_OF_TARGET_TOL_C 2.0F ///< Dialysate temperature out of target tolerance C. -#define DIALYSATE_TEMP_OUT_OF_TARGET_TIMEOUT_MS ( 300 * MS_PER_SECOND ) ///< Dialysate temperature out of target timeout in milliseconds. -#define DIALYSATE_TEMP_HIGH_SAFETY_LIMIT_C 46.0F ///< Dialysate high safety temperature limit in C. -#define DIALYSATE_TEMP_HIGH_SAFETY_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Dialysate temperature high safety timeout in milliseconds. -#define DIALYSATE_TEMP_LOW_SAFETY_LIMIT_C 42.0F ///< Dialysate low safety temperature limit in C. -#define DIALYSATE_TEMP_LOW_SAFETY_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Dialysate temperature low safety timeout in milliseconds. -#define DG_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< DG data freshness timeout (in ms). +#define DIALYSATE_TEMP_OUT_OF_TARGET_TOL_C 2.0F ///< Dialysate temperature out of target tolerance C. +#define DIALYSATE_TEMP_OUT_OF_TARGET_TIMEOUT_MS ( 300 * MS_PER_SECOND ) ///< Dialysate temperature out of target timeout in milliseconds. +#define DIALYSATE_TEMP_HIGH_SAFETY_LIMIT_C 46.0F ///< Dialysate high safety temperature limit in C. +#define DIALYSATE_TEMP_HIGH_SAFETY_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Dialysate temperature high safety timeout in milliseconds. +#define DIALYSATE_TEMP_LOW_SAFETY_LIMIT_C 42.0F ///< Dialysate low safety temperature limit in C. +#define DIALYSATE_TEMP_LOW_SAFETY_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Dialysate temperature low safety timeout in milliseconds. +#define DG_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< DG data freshness timeout (in ms). // ********** private data ********** @@ -235,7 +235,7 @@ void execDGInterfaceMonitor( void ) { // 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 ); + /*checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); // Trigger alarm if not receiving new dialysate temperature data message in timely manner checkDGDataFreshness( ALARM_ID_HD_NEW_DIALYSATE_TEMPERATURE_DATA_MESSAGE_NOT_RECEIVE, &dgDialysateTemperatureDataFreshFlag ); @@ -246,7 +246,7 @@ // Trigger alarm if not receiving new DG op mode message in timely manner checkDGDataFreshness( ALARM_ID_HD_NEW_DG_OPERATION_MODE_MESSAGE_NOT_RECEIVE, &dgOpModeDataFreshFlag ); - // Check to see if DG has restarted + // Check to see if DG has restarted*/ checkDGRestart(); // Check the status of the trimmer heater @@ -452,26 +452,26 @@ /*********************************************************************//** * @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 current dialysate temperature + * @return the current DG disinfects readings *************************************************************************/ -F32 getDialysateTemperature( void ) +DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) { - return dgDialysateTemp; + return disinfectsStatus; } /*********************************************************************//** * @brief - * The getDGDisinfectsStates function returns the DG disinfects readings. - * @details Inputs: none + * The getDialysateTemperature function gets the latest dialysate temperature. + * @details Inputs: dgDialysateTemp * @details Outputs: none - * @return the current DG disinfects readings + * @return the current dialysate temperature *************************************************************************/ -DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) +F32 getDialysateTemperature( void ) { - return disinfectsStatus; + return dgDialysateTemp; } /*********************************************************************//** Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -rccdc42eeb7ed8551848afc45bd5150ddad7db745 -r4031344a26897fb4adc74da2bdc3bd31d414b262 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision ccdc42eeb7ed8551848afc45bd5150ddad7db745) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 4031344a26897fb4adc74da2bdc3bd31d414b262) @@ -71,6 +71,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). @@ -638,7 +639,7 @@ // and setOcclusionInstallLevel has been called. if ( MODE_PRET == getCurrentOperationMode() ) { - if ( getPreTreatmentSubState() > HD_PRE_TREATMENT_CART_INSTALL_STATE && getDrySelfTestsState() > DRY_SELF_TESTS_START_STATE ) + if( getPreTreatmentSubState() > HD_PRE_TREATMENT_CART_INSTALL_STATE && getDrySelfTestsState() > DRY_SELF_TESTS_START_STATE ) { // Check for occlusion if ( bpOccl > ( OCCLUSION_THRESHOLD_OFFSET + bloodPumpOcclusionAfterCartridgeInstall ) ) @@ -648,7 +649,6 @@ } } } - // Check for occlusion in Treatment modes where pumps are moving else if ( MODE_TREA == getCurrentOperationMode() ) { Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -rfae0fd5e204f9e2bfe8084b5e02a5e0a9def1160 -r4031344a26897fb4adc74da2bdc3bd31d414b262 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision fae0fd5e204f9e2bfe8084b5e02a5e0a9def1160) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 4031344a26897fb4adc74da2bdc3bd31d414b262) @@ -93,6 +93,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. @@ -156,8 +157,10 @@ #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. + /// Defined states for the syringe pump control state machine. typedef enum SyringePump_States { Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -ra9368b25cce2a179c56b1609b735178b286bb03d -r4031344a26897fb4adc74da2bdc3bd31d414b262 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision a9368b25cce2a179c56b1609b735178b286bb03d) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 4031344a26897fb4adc74da2bdc3bd31d414b262) @@ -629,8 +629,7 @@ signalBloodPumpHardStop(); signalDialOutPumpHardStop(); - //setDialInPumpTargetFlowRate( DIP_PATIENT_CONNECTION_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); - setDialInPumpTargetFlowRate( 250, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); // TODO remove this line once the new flow control is implemented + setDialInPumpTargetFlowRate( DIP_PATIENT_CONNECTION_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); cmdStartDGTrimmerHeater(); } @@ -1177,6 +1176,7 @@ rsrvrCmd.reservoirID = (U32)DG_RESERVOIR_1; rsrvrCmd.useLastTrimmerHeaterDC = FALSE; reservoirFlushedStatus[ DG_RESERVOIR_1 ] = TRUE; + cmdSetDGActiveReservoir( &rsrvrCmd ); } } @@ -1187,6 +1187,7 @@ rsrvrCmd.reservoirID = (U32)DG_RESERVOIR_2; rsrvrCmd.useLastTrimmerHeaterDC = FALSE; reservoirFlushedStatus[ DG_RESERVOIR_2 ] = TRUE; + cmdSetDGActiveReservoir( &rsrvrCmd ); } } Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -rfae0fd5e204f9e2bfe8084b5e02a5e0a9def1160 -r4031344a26897fb4adc74da2bdc3bd31d414b262 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision fae0fd5e204f9e2bfe8084b5e02a5e0a9def1160) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 4031344a26897fb4adc74da2bdc3bd31d414b262) @@ -354,7 +354,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 ); } } } @@ -1306,8 +1306,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 {