diff --git a/includes/pressure_controller.h b/includes/pressure_controller.h index 475c4830..224f5809 100644 --- a/includes/pressure_controller.h +++ b/includes/pressure_controller.h @@ -161,6 +161,8 @@ class PressureController { */ void updateDt(int32_t p_dt); + void resetBlowerDefaultSpeed(); + private: /** * Update the cycle phase diff --git a/srcs/pressure_controller.cpp b/srcs/pressure_controller.cpp index 71ab752a..9fdd8b97 100644 --- a/srcs/pressure_controller.cpp +++ b/srcs/pressure_controller.cpp @@ -875,3 +875,5 @@ PressureController::pidPatient(int32_t targetPressure, int32_t currentPressure, return patientAperture; } + +void PressureController::resetBlowerDefaultSpeed() { m_blower->runSpeed(DEFAULT_BLOWER_SPEED); } diff --git a/srcs/respirator.cpp b/srcs/respirator.cpp index 03bc0be4..0f752237 100644 --- a/srcs/respirator.cpp +++ b/srcs/respirator.cpp @@ -346,6 +346,7 @@ void loop(void) { pController.compute(centiSec); } else { digitalWrite(PIN_LED_START, LED_START_INACTIVE); + pController.resetBlowerDefaultSpeed(); blower.stop(); // Stop alarms related to breathing cycle