Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r850f74b97895fd0f6c4728541ac2582f7b5c5a0b -r8466e63f95f65a3ffb18c3af85ac99328e41167b --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 850f74b97895fd0f6c4728541ac2582f7b5c5a0b) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 8466e63f95f65a3ffb18c3af85ac99328e41167b) @@ -132,6 +132,8 @@ treatParamsRejected = FALSE; treatmentCancelled = FALSE; + setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, 0.0 ); + // Set user alarm recovery actions allowed in this mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); @@ -343,7 +345,7 @@ TREATMENT_PARAM_T param; // Set all treatment parameters (except UF volume which is not yet received) - for ( param = TREATMENT_PARAM_FIRST_UINT; param < TREATMENT_PARAM_UF_VOLUME; param++ ) + for ( param = TREATMENT_PARAM_FIRST_UINT; param < NUM_OF_TREATMENT_PARAMS; param++ ) { setCriticalData( &treatmentParameters[ param ], stagedParams[ param ] ); } @@ -401,16 +403,13 @@ { BOOL accepted = FALSE; REQUEST_REJECT_REASON_CODE_T rejReason = REQUEST_REJECT_REASON_NONE; - F32 uFVolumeL = uFVolumeMl / (F32)ML_PER_LITER; + F32 uFVolumeL = uFVolumeMl / (F32)ML_PER_LITER; // Validate given UF volume accepted = setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, uFVolumeL ); - if ( FALSE == accepted ) + + if ( TRUE == accepted ) { - rejReason = REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE; - } - else - { U32 treatmentDuration = getTreatmentParameterU32( TREATMENT_PARAM_TREATMENT_DURATION ); if ( treatmentDuration > 0 ) @@ -429,6 +428,10 @@ rejReason = REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM; } } + else + { + rejReason = REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE; + } // Respond to set treatment parameters request message uFVolumeL = getTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME );