Skip to content

Commit

Permalink
Allow fan control in power saving (commaai#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbederks authored Jan 24, 2020
1 parent 186d9dc commit 82cafd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 1 addition & 5 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
break;
// **** 0xb1: set fan power
case 0xb1:
if(power_save_status == POWER_SAVE_STATUS_DISABLED){
current_board->set_fan_power(setup->b.wValue.w);
} else {
puts("Setting fan power not allowed in power saving mode\n");
}
current_board->set_fan_power(setup->b.wValue.w);
break;
// **** 0xb2: get fan rpm
case 0xb2:
Expand Down
3 changes: 1 addition & 2 deletions board/power_saving.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ void set_power_save_state(int state) {
set_gpio_output(GPIOA, 14, enable);
}

// Switch off IR and fan when in power saving
// Switch off IR when in power saving
if(!enable){
current_board->set_ir_power(0U);
current_board->set_fan_power(0U);
}

power_save_status = state;
Expand Down

0 comments on commit 82cafd1

Please sign in to comment.