Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r4b22b45e775c0525bc1d76e83e265af91a59785e -rf861c4c5ab64f429e0b8b9cc456e2ed14e472f2b --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 4b22b45e775c0525bc1d76e83e265af91a59785e) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision f861c4c5ab64f429e0b8b9cc456e2ed14e472f2b) @@ -912,7 +912,7 @@ } } -/************************************************************************* +/*********************************************************************//** * @brief * The checkBloodPumpRotor function checks the rotor for the blood \n * pump. If homing, this function will stop when hall sensor detected. If pump \n Index: firmware/App/Controllers/DGInterface.h =================================================================== diff -u -r47a7da55aea88cd7a2b06870226122d0cc8be540 -rf861c4c5ab64f429e0b8b9cc456e2ed14e472f2b --- firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision 47a7da55aea88cd7a2b06870226122d0cc8be540) +++ firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision f861c4c5ab64f429e0b8b9cc456e2ed14e472f2b) @@ -31,7 +31,7 @@ // ********** public definitions ********** -#define DRAIN_RESERVOIR_TO_VOLUME_ML 200 //100 ///< Drain reservoir to this volume (in mL) during treatment. +#define DRAIN_RESERVOIR_TO_VOLUME_ML 200 ///< Drain reservoir to this volume (in mL) during treatment. #define FILL_RESERVOIR_TO_VOLUME_ML 1700 ///< Fill reservoir to this volume (in mL) during treatment. /// Enumeration of DG reservoirs. Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r4b22b45e775c0525bc1d76e83e265af91a59785e -rf861c4c5ab64f429e0b8b9cc456e2ed14e472f2b --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 4b22b45e775c0525bc1d76e83e265af91a59785e) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision f861c4c5ab64f429e0b8b9cc456e2ed14e472f2b) @@ -156,7 +156,7 @@ static F32 flowReadings[ SIZE_OF_ROLLING_AVG ]; ///< holds flow samples for a rolling average static U32 flowReadingsIdx = 0; ///< index for next sample in rolling average array static F32 flowReadingsTotal = 0.0; ///< rolling total - used to calc average -static U32 flowReadingsCount = 0; ///< # of samples in flow rolling average buffer +static U32 flowReadingsCount = 0; ///< number of samples in flow rolling average buffer static U32 flowReadingsTmrCtr = 0; ///< determines when to add samples to filter static U32 dipCurrErrorDurationCtr = 0; ///< used for tracking persistence of dip current errors @@ -822,7 +822,7 @@ } } -/************************************************************************* +/*********************************************************************//** * @brief * The checkDialInPumpRotor function checks the rotor for the dialysate inlet \n * pump. If homing, this function will stop when hall sensor detected. If pump \n Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r47a7da55aea88cd7a2b06870226122d0cc8be540 -rf861c4c5ab64f429e0b8b9cc456e2ed14e472f2b --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 47a7da55aea88cd7a2b06870226122d0cc8be540) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision f861c4c5ab64f429e0b8b9cc456e2ed14e472f2b) @@ -429,6 +429,8 @@ } // send response to request sendChangeTreatmentDurationResponse( result, rejectReason, presTreatmentTimeSecs / SEC_PER_MIN, presMaxUFVolumeML ); + // send new ranges for settings + broadcastTreatmentSettingsRanges(); return result; } @@ -479,28 +481,34 @@ // start t/o timer - user must confirm UF changes within 1 minute from now pendingParamChangesTimer = getMSTimerCount(); - // verify UF rate change would be valid (this should be as UI is getting regular UF volume range updates) + // verify UF rate change would be valid (leave zero if not valid - UI will disable option) if ( uFRate <= (F32)MAX_UF_RATE_ML_MIN ) { result = TRUE; pendingUFVolumeChange = uFVolume; pendingUFRateChange = uFRate; rateDiff = ( uFRate - presUFRate ); - - // verify treatment duration change would be valid (leave zero if not valid - UI will disable option) - if ( ( trtTime <= MAX_TREATMENT_TIME_MINUTES ) && ( trtTime >= MIN_TREATMENT_TIME_MINUTES ) && - ( dialVolume <= MAX_DIALYSATE_VOLUME_ML ) ) - { - pendingTreatmentTimeChange = trtTime; - timeDiff = trtTime - ( (U32)( (F32)presTreatmentTimeSecs / (F32)SEC_PER_MIN ) + 1 ); - } - else - { - pendingTreatmentTimeChange = 0; - } } else { + pendingUFRateChange = 0.0; + } + // verify treatment duration change would be valid (leave zero if not valid - UI will disable option) + if ( ( trtTime <= MAX_TREATMENT_TIME_MINUTES ) && ( trtTime >= MIN_TREATMENT_TIME_MINUTES ) && + ( dialVolume <= MAX_DIALYSATE_VOLUME_ML ) ) + { + result = TRUE; + pendingUFVolumeChange = uFVolume; + pendingTreatmentTimeChange = trtTime; + timeDiff = trtTime - ( (U32)( (F32)presTreatmentTimeSecs / (F32)SEC_PER_MIN ) + 1 ); + } + else + { + pendingTreatmentTimeChange = 0; + } + // if neither option works, reject for UF rate + if ( FALSE == result ) + { rejectReason = REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE; } } @@ -589,6 +597,8 @@ } // respond to UF settings change confirmation sendChangeUFSettingsOptionResponse( result, rejectReason, presMaxUFVolumeML, presTreatmentTimeSecs / SEC_PER_MIN, presUFRate ); + // send new ranges for settings + broadcastTreatmentSettingsRanges(); return result; } @@ -647,6 +657,8 @@ rejectReason = REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE; } sendChangeBloodDialysateRateChangeResponse( result, (U32)rejectReason, presBloodFlowRate, presDialysateFlowRate ); + // send new ranges for settings + broadcastTreatmentSettingsRanges(); return result; }