Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r9798f57bc288270fe058fe098a76088cbb34d50c -rbb80dbac26147ab08413efa91007f7ffed43c38f --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 9798f57bc288270fe058fe098a76088cbb34d50c) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision bb80dbac26147ab08413efa91007f7ffed43c38f) @@ -24,6 +24,7 @@ #include "DialOutFlow.h" #include "ModeTreatmentParams.h" #include "OperationModes.h" +#include "SyringePump.h" #include "SystemCommMessages.h" /** @@ -349,6 +350,16 @@ origTreatmentParams.venousPressureLowLimit_mmHg = getCriticalData( &treatmentParameters[ TREATMENT_PARAM_VEN_PRESSURE_LOW_LIMIT ] ).sInt; origTreatmentParams.venousPressureHighLimit_mmHg = getCriticalData( &treatmentParameters[ TREATMENT_PARAM_VEN_PRESSURE_HIGH_LIMIT ] ).sInt; + // If using Heparin in this treatment, set state to stopped otherwise off + if ( ( stagedParams[ TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ] > 0.0 ) || ( stagedParams[ TREATMENT_PARAM_HEPARIN_DISPENSE_RATE ] > 0.0 ) ) + { + setHeparinStopped(); + } + else + { + setHeparinOff(); + } + // Go to pre-treatment mode requestNewOperationMode( MODE_PRET ); @@ -596,11 +607,12 @@ *************************************************************************/ static void sendTreatmentParamsResponse( BOOL rejected, U32 *reasons ) { + BOOL accepted = ( TRUE == rejected ? FALSE : TRUE ); U32 respPayload[NUM_OF_TREATMENT_PARAMS]; memcpy( &respPayload[0], &reasons[0], sizeof(TREATMENT_PARAMS_DATA_PAYLOAD_T) ); - sendTreatmentParametersResponseMsg( rejected, (U08*)(&respPayload[0]), ( NUM_OF_TREATMENT_PARAMS - 1 ) * sizeof(U32) ); // UF vol. param not included in reject reasons + sendTreatmentParametersResponseMsg( accepted, (U08*)(&respPayload[0]), ( NUM_OF_TREATMENT_PARAMS - 1 ) * sizeof(U32) ); // UF vol. param not included in reject reasons } /*********************************************************************//**