diff --git a/board/main.c b/board/main.c index c6e4f0f..0ce54f8 100644 --- a/board/main.c +++ b/board/main.c @@ -614,6 +614,10 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired) case 0xf6: siren_enabled = (setup->b.wValue.w != 0U); break; + // **** 0xf7: set green led enabled + case 0xf7: + green_led_enabled = (setup->b.wValue.w != 0U); + break; default: puts("NO HANDLER "); puth(setup->b.bRequest); @@ -701,7 +705,7 @@ void TIM1_BRK_TIM9_IRQ_Handler(void) { fan_tick(); // set green LED to be controls allowed - current_board->set_led(LED_GREEN, controls_allowed); + current_board->set_led(LED_GREEN, controls_allowed | green_led_enabled); // turn off the blue LED, turned on by CAN // unless we are in power saving mode diff --git a/board/main_declarations.h b/board/main_declarations.h index 7fa2c4b..ade4aca 100644 --- a/board/main_declarations.h +++ b/board/main_declarations.h @@ -14,3 +14,4 @@ bool is_enumerated = 0; uint32_t heartbeat_counter = 0; uint32_t uptime_cnt = 0; bool siren_enabled = false; +bool green_led_enabled = false; diff --git a/python/__init__.py b/python/__init__.py index 936c975..b22b010 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -676,3 +676,7 @@ class Panda(object): # ****************** Siren ***************** def set_siren(self, enabled): self._handle.controlWrite(Panda.REQUEST_OUT, 0xf6, int(enabled), 0, b'') + + # ****************** Debug ***************** + def set_green_led(self, enabled): + self._handle.controlWrite(Panda.REQUEST_OUT, 0xf7, int(enabled), 0, b'')