diff --git a/srcs/pressure_controller.cpp b/srcs/pressure_controller.cpp index c99a291c..dce46d5c 100644 --- a/srcs/pressure_controller.cpp +++ b/srcs/pressure_controller.cpp @@ -454,7 +454,7 @@ void PressureController::updatePeakPressure() { if (abs(plateauDelta) > 20) { m_maxPeakPressureCommand = - min(min(m_peakPressure, m_maxPeakPressureCommand) + plateauDelta, + min((min(m_peakPressure, m_maxPeakPressureCommand) + plateauDelta), static_cast(CONST_MAX_PEAK_PRESSURE)); } else if ((abs(plateauDelta) < 20) && (abs(plateauDelta) > 5)) { m_maxPeakPressureCommand =