Skip to content

Commit

Permalink
reorders Fan functions
Browse files Browse the repository at this point in the history
  • Loading branch information
BlakeFreer committed Apr 7, 2024
1 parent 8253881 commit 15723cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions firmware/projects/TMS/inc/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand All @@ -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_;

Expand Down

0 comments on commit 15723cd

Please sign in to comment.