Closed MrJake222 closed 4 months ago
moved from pico-ice-sdk
Hi,
I'm sending/receiving 2-byte frames to/from iCE40 via ACM1 virtual serial port. The serial.read function always stalls for 20ms. I think it's related to the SDK (not Python or kernel) because ACM0 doesn't have this delay.
ACM1
serial.read
ACM0
Turns out waiting for user input in main loop is not the best strategy. https://github.com/tinyvision-ai-inc/pico-ice/blob/f9bd6e648ee60ef808dcea329a99da570e69a52e/Firmware/pico-ice-default/main.c#L58-L62 That's not how this works. getchar_timeout_us calls stdio_get_until which waits internally!
getchar_timeout_us
stdio_get_until
Thank you, great insight about stdio_get_until busy looping in the "driver"/"hal"/"sdk" code!
moved from pico-ice-sdk
Hi,
I'm sending/receiving 2-byte frames to/from iCE40 via
ACM1
virtual serial port. Theserial.read
function always stalls for 20ms. I think it's related to the SDK (not Python or kernel) becauseACM0
doesn't have this delay.Resolution
Turns out waiting for user input in main loop is not the best strategy. https://github.com/tinyvision-ai-inc/pico-ice/blob/f9bd6e648ee60ef808dcea329a99da570e69a52e/Firmware/pico-ice-default/main.c#L58-L62 That's not how this works.
getchar_timeout_us
callsstdio_get_until
which waits internally!