From 018b7321ed454c3f4ef7788be98cc5a69b7ae847 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 8 Feb 2024 17:06:28 +0100 Subject: [PATCH] pkg/tinyusb/cdc_acm_stdio: only enable RX callback if stdin is active --- pkg/tinyusb/cdc_acm_stdio/cdc_acm_stdio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/tinyusb/cdc_acm_stdio/cdc_acm_stdio.c b/pkg/tinyusb/cdc_acm_stdio/cdc_acm_stdio.c index e6b2306d47bf..1bb71d54e3f6 100644 --- a/pkg/tinyusb/cdc_acm_stdio/cdc_acm_stdio.c +++ b/pkg/tinyusb/cdc_acm_stdio/cdc_acm_stdio.c @@ -44,6 +44,7 @@ static ssize_t _write(const void* buffer, size_t len) return (char *)buffer - start; } +#ifdef MODULE_STDIN void tud_cdc_rx_cb(uint8_t itf) { (void)itf; @@ -52,5 +53,6 @@ void tud_cdc_rx_cb(uint8_t itf) unsigned res = tud_cdc_read(buffer, sizeof(buffer)); isrpipe_write(&stdin_isrpipe, buffer, res); } +#endif STDIO_PROVIDER(STDIO_TINYUSB_CDC_ACM, NULL, NULL, _write)