Skip to content

Unexpected behavior on Serial2 #378

Answered by earlephilhower
currentc57 asked this question in Q&A
Discussion options

You must be logged in to vote

What am I missing here?

Nothing, you're correct. The Serial port is USB and has a very different code path than Serial1/2 which are UART based.

The Pico-SDK, when I looked at it and wrote the core, only let us know if the HW UART FIFO was readable or not, and did not give any indication as to exactly how full it was. So, the code is only returning ever 0 or 1.

return (uart_is_readable(_uart)) ? 1 : 0;

I'll have to look at the SDK and see if there is some way to see what the actual FIFO count is. Alternatively, the Serial`/2 ports might need to implement their own software FIFOs and use IRQs to fill them from …

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by currentc57
Comment options

You must be logged in to vote
1 reply
@earlephilhower
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@earlephilhower
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants