Fix builds for which UART_TX_LED aren't defined

This commit is contained in:
Jonathan Bell
2024-03-18 16:37:26 +00:00
parent ddc028fe18
commit b5962e0818

View File

@@ -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;
}
}