Skip to content

Commit

Permalink
Patch for Pico SDK 2.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Aug 9, 2024
1 parent a97797d commit 7780216
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ bool cdc_wait_for(std::string_view data, uint timeout_ms=50) {
while(1){
tud_task();
if (cdc_task((uint8_t *)&got_char, 1) == 1) break;
if(check_timeout(&ts)) return false;
if(check_timeout(&ts, false)) return false;
}
if (got_char != expected_char) return false;
}
Expand All @@ -111,7 +111,7 @@ size_t cdc_get_bytes(const uint8_t *buffer, const size_t len, const uint timeout
check_timeout_fn check_timeout = init_single_timeout_until(&ts, until);

size_t bytes_remaining = len;
while (bytes_remaining && !check_timeout(&ts)) {
while (bytes_remaining && !check_timeout(&ts, false)) {
tud_task(); // tinyusb device task
size_t bytes_read = cdc_task(p, std::min(bytes_remaining, MAX_UART_PACKET));
bytes_remaining -= bytes_read;
Expand Down

0 comments on commit 7780216

Please sign in to comment.