diff --git a/firmware/projects/TMS/inc/app.h b/firmware/projects/TMS/inc/app.h index 41b7bff39..3be70b28a 100644 --- a/firmware/projects/TMS/inc/app.h +++ b/firmware/projects/TMS/inc/app.h @@ -90,6 +90,11 @@ class FanContoller { temp_to_power_(temp_to_power), pwm_step_size_(pwm_step_size) {} + void Start(float initial_power) { + pwm_.Start(); + pwm_.SetDutyCycle(power_to_pwm_.Evaluate(initial_power)); + } + void Update(float temperature) { // convert pwm = 100 - power since the fan runs on inverse logic // ex. pwm=20% => fan is running at 80% @@ -104,11 +109,6 @@ class FanContoller { pwm_.SetDutyCycle(current_pwm + pwm_step); } - void Start(float initial_power) { - pwm_.Start(); - pwm_.SetDutyCycle(power_to_pwm_.Evaluate(initial_power)); - } - private: shared::periph::PWMOutput& pwm_;