Skip to content

Commit b5962e0

Browse files
committed
Fix builds for which UART_TX_LED aren't defined
1 parent ddc028f commit b5962e0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/cdc_uart.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ bool cdc_task(void)
146146
if (((int)break_expiry - (int)xTaskGetTickCount()) < 0) {
147147
timed_break = false;
148148
uart_set_break(PROBE_UART_INTERFACE, false);
149+
#ifdef PROBE_UART_TX_LED
149150
tx_led_debounce = 0;
151+
#endif
150152
} else {
151153
keep_alive = true;
152154
}
@@ -156,7 +158,9 @@ bool cdc_task(void)
156158
uart_set_break(PROBE_UART_INTERFACE, false);
157159
timed_break = false;
158160
was_connected = 0;
161+
#ifdef PROBE_UART_TX_LED
159162
tx_led_debounce = 0;
163+
#endif
160164
cdc_tx_oe = 0;
161165
}
162166
return keep_alive;
@@ -278,15 +282,19 @@ void tud_cdc_send_break_cb(uint8_t itf, uint16_t wValue) {
278282
case 0xffff:
279283
uart_set_break(PROBE_UART_INTERFACE, true);
280284
timed_break = false;
285+
#ifdef PROBE_UART_TX_LED
281286
gpio_put(PROBE_UART_TX_LED, 1);
282287
tx_led_debounce = 1 << 30;
288+
#endif
283289
break;
284290
default:
285291
uart_set_break(PROBE_UART_INTERFACE, true);
286292
timed_break = true;
293+
#ifdef PROBE_UART_TX_LED
287294
gpio_put(PROBE_UART_TX_LED, 1);
288-
break_expiry = xTaskGetTickCount() + (wValue * (configTICK_RATE_HZ / 1000));
289295
tx_led_debounce = 1 << 30;
296+
#endif
297+
break_expiry = xTaskGetTickCount() + (wValue * (configTICK_RATE_HZ / 1000));
290298
break;
291299
}
292300
}

0 commit comments

Comments
 (0)