Skip to content

Commit

Permalink
Added the option to turn on IR in power savings mode (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbederks authored Jan 31, 2020
1 parent 82cafd1 commit d034f3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d034f3e

Please sign in to comment.