diff --git a/src/cdc_uart.c b/src/cdc_uart.c index c6e4c67..6f2450a 100644 --- a/src/cdc_uart.c +++ b/src/cdc_uart.c @@ -146,7 +146,9 @@ bool cdc_task(void) if (((int)break_expiry - (int)xTaskGetTickCount()) < 0) { timed_break = false; uart_set_break(PROBE_UART_INTERFACE, false); +#ifdef PROBE_UART_TX_LED tx_led_debounce = 0; +#endif } else { keep_alive = true; } @@ -156,7 +158,9 @@ bool cdc_task(void) uart_set_break(PROBE_UART_INTERFACE, false); timed_break = false; was_connected = 0; +#ifdef PROBE_UART_TX_LED tx_led_debounce = 0; +#endif cdc_tx_oe = 0; } return keep_alive; @@ -278,15 +282,19 @@ void tud_cdc_send_break_cb(uint8_t itf, uint16_t wValue) { case 0xffff: uart_set_break(PROBE_UART_INTERFACE, true); timed_break = false; +#ifdef PROBE_UART_TX_LED gpio_put(PROBE_UART_TX_LED, 1); tx_led_debounce = 1 << 30; +#endif break; default: uart_set_break(PROBE_UART_INTERFACE, true); timed_break = true; +#ifdef PROBE_UART_TX_LED gpio_put(PROBE_UART_TX_LED, 1); - break_expiry = xTaskGetTickCount() + (wValue * (configTICK_RATE_HZ / 1000)); tx_led_debounce = 1 << 30; +#endif + break_expiry = xTaskGetTickCount() + (wValue * (configTICK_RATE_HZ / 1000)); break; } }