Added the option to turn on IR in power savings mode (#431)

master
robbederks 2020-01-30 19:23:19 -08:00 committed by GitHub
parent 82cafd10ea
commit d034f3e9c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -294,11 +294,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
break;
// **** 0xb0: set IR power
case 0xb0:
if(power_save_status == POWER_SAVE_STATUS_DISABLED){
current_board->set_ir_power(setup->b.wValue.w);
} else {
puts("Setting IR power not allowed in power saving mode\n");
}
current_board->set_ir_power(setup->b.wValue.w);
break;
// **** 0xb1: set fan power
case 0xb1:
@ -712,6 +708,10 @@ void TIM1_BRK_TIM9_IRQ_Handler(void) {
if (power_save_status != POWER_SAVE_STATUS_ENABLED) {
set_power_save_state(POWER_SAVE_STATUS_ENABLED);
}
// Also disable fan and IR when the heartbeat goes missing
current_board->set_fan_power(0U);
current_board->set_ir_power(0U);
}
// enter CDP mode when car starts to ensure we are charging a turned off EON