Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -r242ad36c7a1ec4ee5012c9f009899f9e0bd87628 -rd089b3bd30b565fb264817b6df70e083d8a9ec46 --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 242ad36c7a1ec4ee5012c9f009899f9e0bd87628) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision d089b3bd30b565fb264817b6df70e083d8a9ec46) @@ -266,13 +266,6 @@ getNVRecord2Driver( GET_CAL_BLOOD_LEAK_SENSOR, (U08*)&bloodLeakCalRecord, length, 0, ALARM_ID_HD_BLOOD_LEAK_INVALID_CAL_RECORD ); } - if ( bloodLeakState >= BLOOD_LEAK_INIT_STATE ) - { - enqueueEmbModeCmd( I_EMB_MODE_CMD ); - enqueueEmbModeCmd( V_EMB_MODE_CMD ); - enqueueEmbModeCmd( D_EMB_MODE_CMD ); - } - switch( bloodLeakState ) { case BLOOD_LEAK_WAIT_FOR_POST_STATE: @@ -1210,6 +1203,15 @@ broadcastData( MSG_ID_HD_BLOOD_LEAK_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&data, sizeof( BLOOD_LEAK_DATA_T ) ); bloodLeakDataPublicationTimerCounter = 0; + + if ( ( bloodLeakState >= BLOOD_LEAK_INIT_STATE ) && ( FALSE == bloodLeakEmbModeHasZeroBeenRqustd ) ) + { + // Once the previous data was broadcast, and the system is not in init and blood leak zero request has not been set, enqueue the data + // to be queried and read again. The data is queried here to make sure there is a second of time in between the queries for I, V, and D + enqueueEmbModeCmd( I_EMB_MODE_CMD ); + enqueueEmbModeCmd( V_EMB_MODE_CMD ); + enqueueEmbModeCmd( D_EMB_MODE_CMD ); + } } } Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r0bce81180c0ba2b25f5d501ed6aa6b2f9a8b2500 -rd089b3bd30b565fb264817b6df70e083d8a9ec46 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 0bce81180c0ba2b25f5d501ed6aa6b2f9a8b2500) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision d089b3bd30b565fb264817b6df70e083d8a9ec46) @@ -1031,6 +1031,7 @@ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_DIALYSATE_TEMP_CHECK ) != SW_CONFIG_ENABLE_VALUE ) #endif { + // Per PRS 377, PRS 124 checkPersistentAlarm( ALARM_ID_HD_DIALYSATE_TEMP_OUT_OF_HIGH_SAFETY_RANGE, isTDiTempAboveHighSafety, dgDialysateTemp, DIALYSATE_TEMP_HIGH_SAFETY_LIMIT_C ); checkPersistentAlarm( ALARM_ID_HD_DIALYSATE_TEMP_OUT_OF_LOW_SAFETY_RANGE, isTDiTempAboveLowSafety, dgDialysateTemp, DIALYSATE_TEMP_LOW_SAFETY_LIMIT_C ); Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -rfb1673d2282822995ed233f3e9ea5dfb0567780d -rd089b3bd30b565fb264817b6df70e083d8a9ec46 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision fb1673d2282822995ed233f3e9ea5dfb0567780d) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision d089b3bd30b565fb264817b6df70e083d8a9ec46) @@ -25,8 +25,8 @@ #define MAX_RESERVOIR_DILUTION 0.15F ///< Maximum reservoir dilution limit. #define MAX_RESERVOIR_RECIRCULATION 1.1F ///< Maximum reservoir recirculation limit. -#define MAX_RESERVOIR_DEPLETION_TIME_MS ( 30 * SEC_PER_MIN * MS_PER_SECOND ) ///< Maximum allowed depletion time in milliseconds. -#define RESERVOIR_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the reservoir data is published on the CAN bus. +#define MAX_RESERVOIR_DEPLETION_TIME_MS ( 30 * SEC_PER_MIN * MS_PER_SECOND ) ///< Maximum allowed depletion time in milliseconds. +#define RESERVOIR_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the reservoir data is published on the CAN bus. #define RESERVOIR_DEPLETION_INTERVAL ( MAX_RESERVOIR_DEPLETION_TIME_MS / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) for maximum allowed depletion time. #define DIALYSATE_FLOW_RATE_350_ML_PER_MIN 0.35F ///< Dialysate flow rate 350 mL/min. @@ -57,22 +57,22 @@ } TREATMENT_RESERVOIR_MGMT_STATE_T; static TREATMENT_RESERVOIR_MGMT_STATE_T reservoirsState; ///< Treatment mode's reservoirs state. -static U32 timeStartMS = 0; ///< Active reservoir start time in milliseconds. -static U32 timeDepleteMS = 0; ///< Active reservoir depletion time in milliseconds. -static F32 volSpentML = 0.0; ///< Active reservoir spent volume in milliliters. -static U32 reservoirPublicationCounter = 0; ///< Reservoirs data publication timer counter. -static F32 dilutionLevelPct = 0.0; ///< Reservoir dilution level. -static DG_OP_MODE_T dgOpMode = DG_MODE_INIT; ///< DG operation mode. -static U32 dgSubMode = 0; ///< DG operation submode. -static U32 timeReservoirInUse = 0; ///< Reservoir time in use in milliseconds. -static F32 volSpentUFML = 0.0; ///< Ultrafiltration volume in milliliters. +static U32 timeStartMS; ///< Active reservoir start time in milliseconds. +static U32 timeDepleteMS; ///< Active reservoir depletion time in milliseconds. +static F32 volSpentML; ///< Active reservoir spent volume in milliliters. +static U32 reservoirPublicationCounter; ///< Reservoirs data publication timer counter. +static F32 dilutionLevelPct; ///< Reservoir dilution level. +static DG_OP_MODE_T dgOpMode; ///< DG operation mode. +static U32 dgSubMode; ///< DG operation submode. +static U32 timeReservoirInUse; ///< Reservoir time in use in milliseconds. +static F32 volSpentUFML; ///< Ultrafiltration volume in milliliters. static DG_RESERVOIR_ID_T activeReservoir; ///< Active reservoir. -static F32 recirculationLevelPct = 0.0; ///< Recirculation level in percent. -static U32 reservoirSwitchStartTimeMS = 0; ///< Reservoir switch start time in milliseconds. -static S32 timeWaitToFillMS = 0; ///< Time to wait to fill in milliseconds. -static F32 targetFillFlowLPM = 0.0; ///< Target fill flow in liters/minutes. -static U32 previousDialysateFlowMLP = 0; ///< Previous dialysate flow rate in mL/min. -static F32 previousUFFlowMLP = 0.0; ///< Previous ultrafiltration flow rate in mL/min. +static F32 recirculationLevelPct; ///< Recirculation level in percent. +static U32 reservoirSwitchStartTimeMS; ///< Reservoir switch start time in milliseconds. +static S32 timeWaitToFillMS; ///< Time to wait to fill in milliseconds. +static F32 targetFillFlowLPM; ///< Target fill flow in liters/minutes. +static U32 previousDialysateFlowMLP; ///< Previous dialysate flow rate in mL/min. +static F32 previousUFFlowMLP; ///< Previous ultrafiltration flow rate in mL/min. static DG_MIXING_RATIOS_T ratios; ///< Mixing ratios and fill prep time in milliseconds structure. static const F32 RESERVOIR_DILUTION_RATIO = MAX_RESERVOIR_DILUTION / ( 1.0 - MAX_RESERVOIR_DILUTION ); ///< Reservoir dilution ratio. @@ -117,21 +117,22 @@ reservoirsState = TREATMENT_RESERVOIR_MGMT_START_STATE; timeStartMS = getMSTimerCount(); timeDepleteMS = 0; - volSpentML = 0.0; + volSpentML = 0.0F; reservoirPublicationCounter = 0; - dilutionLevelPct = 0.0; + dilutionLevelPct = 0.0F; dgOpMode = DG_MODE_INIT; dgSubMode = 0; timeReservoirInUse = 0; - volSpentUFML = 0.0; + volSpentUFML = 0.0F; activeReservoir = DG_RESERVOIR_1; - recirculationLevelPct = 0.0; + recirculationLevelPct = 0.0F; reservoirSwitchStartTimeMS = 0; timeWaitToFillMS = 0; - targetFillFlowLPM = 0.0; + targetFillFlowLPM = 0.0F; previousDialysateFlowMLP = 0; - ratios.acidMixingRatio = 0.0; - ratios.bicarbMixingRatio = 0.0; + previousUFFlowMLP = 0.0F; + ratios.acidMixingRatio = 0.0F; + ratios.bicarbMixingRatio = 0.0F; ratios.timeFillPrepMS = 0; } @@ -368,6 +369,7 @@ if ( ( previousDialysateFlowMLP != dialysateFlowMLP ) || ( previousUFFlowMLP != targetUFFlowMLP ) ) { DG_CMD_DIALYSATE_HEATING_PARAMS_T params; + params.trimmerTargetTemperature = getTreatmentParameterF32( TREATMENT_PARAM_DIALYSATE_TEMPERATURE ); params.timeReservoirWait2SwitchMS = RESERVOIR_SETTLE_TIME_MS + RESERVOIR_CYCLE_EXTRA_MARGIN_TIME_MS; params.timeReservoirFillMS = fillTimeMS;