Added the option to turn on IR in power savings mode
@@ -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");
- }
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
