getchar_timeout_us sleeps 1 µs even when timeout is 0. #845

Closed
opened 2022-06-03 10:17:28 -05:00 by FunMiles · 1 comment
FunMiles commented 2022-06-03 10:17:28 -05:00 (Migrated from github.com)

A call such as:

   char c = getchar_timeout_us(0);

ends up in a busy loop for 1µs even though the timeout is 0.

A check of 0 timeout with a quick exit should precede that line.

A call such as: ```c char c = getchar_timeout_us(0); ``` ends up [in a busy loop for 1µs](https://github.com/raspberrypi/pico-sdk/blob/426e46126b5a1efaea4544cdb71ab81b61983034/src/rp2_common/pico_stdio/stdio.c#L136) even though the timeout is 0. A check of 0 timeout with a quick exit should precede that line.
kilograham commented 2022-06-20 12:52:13 -05:00 (Migrated from github.com)

merged into develop

merged into develop
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#845
No description provided.