Skip to content

Commit

Permalink
pkg/tinyusb/cdc_acm_stdio: only enable RX callback if stdin is active
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Feb 9, 2024
1 parent 2d22cc8 commit 018b732
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/tinyusb/cdc_acm_stdio/cdc_acm_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)

0 comments on commit 018b732

Please sign in to comment.