Skip to content

Commit d034f3e

Browse files
authored
Added the option to turn on IR in power savings mode (commaai#431)
1 parent 82cafd1 commit d034f3e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

board/main.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
294294
break;
295295
// **** 0xb0: set IR power
296296
case 0xb0:
297-
if(power_save_status == POWER_SAVE_STATUS_DISABLED){
298-
current_board->set_ir_power(setup->b.wValue.w);
299-
} else {
300-
puts("Setting IR power not allowed in power saving mode\n");
301-
}
297+
current_board->set_ir_power(setup->b.wValue.w);
302298
break;
303299
// **** 0xb1: set fan power
304300
case 0xb1:
@@ -712,6 +708,10 @@ void TIM1_BRK_TIM9_IRQ_Handler(void) {
712708
if (power_save_status != POWER_SAVE_STATUS_ENABLED) {
713709
set_power_save_state(POWER_SAVE_STATUS_ENABLED);
714710
}
711+
712+
// Also disable fan and IR when the heartbeat goes missing
713+
current_board->set_fan_power(0U);
714+
current_board->set_ir_power(0U);
715715
}
716716

717717
// enter CDP mode when car starts to ensure we are charging a turned off EON

0 commit comments

Comments
 (0)