Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -re288ab9857122bfcc9e9fe4f83d0a4f5e67231a3 -re7b65409100c66dfe8b1a18b89c5245adb21ce2d --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision e288ab9857122bfcc9e9fe4f83d0a4f5e67231a3) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision e7b65409100c66dfe8b1a18b89c5245adb21ce2d) @@ -42,7 +42,7 @@ /// Default publication interval for pressure and occlusion data. #define PRES_OCCL_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the pressure/occlusion data is published on the CAN bus. -#define PRES_LIMIT_STABILIZATION_TIME_MS ( 30 * MS_PER_SECOND ) ///< Duration of pressure limit stabilization period (in ms). +#define PRES_LIMIT_STABILIZATION_TIME_MS ( 60 * MS_PER_SECOND ) ///< Duration of pressure limit stabilization period (in ms). #define PRES_LIMIT_RESTABILIZE_TIME_MS ( 30 * SEC_PER_MIN * MS_PER_SECOND ) ///< Duration of pressure limit re-stabilize period (in ms). #define ARTERIAL_PRESSURE_CONVERSION_OFFSET 0x800000 ///< Arterial pressure conversion coefficient. Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r61329f4338e01017c1b31d063a17a187ec12c37d -re7b65409100c66dfe8b1a18b89c5245adb21ce2d --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 61329f4338e01017c1b31d063a17a187ec12c37d) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision e7b65409100c66dfe8b1a18b89c5245adb21ce2d) @@ -888,8 +888,24 @@ { TREATMENT_STATE_T result = TREATMENT_RINSEBACK_STATE; - // Execute treatment rinseback sub-mode - execRinseback(); + // If user requests treatment end, end treatment + if ( TRUE == endTreatmentAlarmResponseRequest ) + { + sendLastTreatmentPeriodicData = TRUE; + requestNewOperationMode( MODE_POST ); + } + // Otherwise execute state machine for treatment rinseback sub-mode + else + { + // If user requests resumption of treatment, resume rinseback + if ( TRUE == resumeTreatmentAlarmResponseRequest ) + { + resumeTreatmentAlarmResponseRequest = FALSE; + signalRinsebackAlarmResumeUserAction(); + } + // Execute treatment rinseback sub-mode + execRinseback(); + } // Handle signals from rinseback sub-mode if ( TRUE == rinsebackToRecircRequest ) Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r80108771999ace3313b3f788df487e8e4ee38019 -re7b65409100c66dfe8b1a18b89c5245adb21ce2d --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 80108771999ace3313b3f788df487e8e4ee38019) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision e7b65409100c66dfe8b1a18b89c5245adb21ce2d) @@ -343,6 +343,9 @@ // Has user requested rinseback start? if ( TRUE == startRinsebackRequested ) { + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); if ( isTreatmentCompleted() != TRUE ) { sendTreatmentLogEventData( MID_TREATMENT_RINSE_BACK_EVENT, 0.0, rinsebackRate_mL_min ); @@ -393,13 +396,19 @@ // Has user requested to end rinseback? if ( TRUE == endRinsebackRequested ) { + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); setupForRinsebackStopOrPause(); targetRinsebackVolumePlusAdditional_mL = getRinsebackVolume(); result = RINSEBACK_STOP_STATE; } // Has rinseback completed? else if ( getRinsebackVolume() >= rinsebackTargetVolume_mL ) { + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); setRinsebackIsCompleted( TRUE ); setupForRinsebackStopOrPause(); targetRinsebackVolumePlusAdditional_mL = getRinsebackVolume(); @@ -472,6 +481,9 @@ // Has user requested to end rinseback? else if ( TRUE == endRinsebackRequested ) { + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); targetRinsebackVolumePlusAdditional_mL = getRinsebackVolume(); result = RINSEBACK_STOP_STATE; } @@ -592,6 +604,19 @@ /*********************************************************************//** * @brief + * The signalRinsebackAlarmResumeUserAction function signals the rinseback + * sub-mode to resume per user alarm action. + * @details Inputs: none + * @details Outputs: resumeRinsebackRequested + * @return none + *************************************************************************/ +void signalRinsebackAlarmResumeUserAction( void ) +{ + resumeRinsebackRequested = TRUE; +} + +/*********************************************************************//** + * @brief * The signalRinsebackUserAction function signals a rinseback user action * has been requested. The request is handled and responded to. * @details Inputs: none Index: firmware/App/Modes/Rinseback.h =================================================================== diff -u -r0a4dcd288d4347b85baaa0b07da568b6add5eac7 -re7b65409100c66dfe8b1a18b89c5245adb21ce2d --- firmware/App/Modes/Rinseback.h (.../Rinseback.h) (revision 0a4dcd288d4347b85baaa0b07da568b6add5eac7) +++ firmware/App/Modes/Rinseback.h (.../Rinseback.h) (revision e7b65409100c66dfe8b1a18b89c5245adb21ce2d) @@ -55,6 +55,7 @@ void transitionToRinseback( void ); void execRinseback( void ); +void signalRinsebackAlarmResumeUserAction( void ); // from user response to alarm void signalRinsebackUserAction( REQUESTED_RINSEBACK_USER_ACTIONS_T action ); // from user RINSEBACK_STATE_T getCurrentRinsebackState( void ); Index: firmware/App/Modes/TreatmentEnd.c =================================================================== diff -u -r2b79e2d880e3ed9867321835388011726d0a2e52 -re7b65409100c66dfe8b1a18b89c5245adb21ce2d --- firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 2b79e2d880e3ed9867321835388011726d0a2e52) +++ firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision e7b65409100c66dfe8b1a18b89c5245adb21ce2d) @@ -329,7 +329,7 @@ /*********************************************************************//** * @brief * The signalTreatmentEndAlarmResumeUserAction function signals the treatment end - * sub-mode to stop per an active alarm. + * sub-mode to resume per user alarm action. * @details Inputs: none * @details Outputs: txEndAlarmResumeRequested * @return none @@ -342,7 +342,7 @@ /*********************************************************************//** * @brief * The signalTreatmentEndAlarmRinsebackUserAction function signals the treatment end - * sub-mode to stop per an active alarm. + * sub-mode to start rinseback per user alarm action. * @details Inputs: none * @details Outputs: txEndAlarmRinsebackRequested * @return none @@ -355,7 +355,7 @@ /*********************************************************************//** * @brief * The signalTreatmentEndAlarmEndTxUserAction function signals the treatment end - * sub-mode to stop per an active alarm. + * sub-mode to end treatment per user alarm action. * @details Inputs: none * @details Outputs: txEndAlarmEndTreatmentRequested * @return none