-
Notifications
You must be signed in to change notification settings - Fork 1.1k
pico_stdio improvements #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
kilograham
commented
Oct 7, 2021
- add stdio_usb_connected() method
- add PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS to allow waiting for CDC connection during init
- add puts_raw and putchar_raw to skip any CR/LF translation
add PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS to allow waiting for CDC connection during init add puts_raw and putchar_raw to skip any CR/LF translation
* | ||
* \return true if stdio is connected over CDC | ||
*/ | ||
bool stdio_usb_connected(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a common usage-idiom (for example-code that wants to be switchable between UART and USB-CDC using just the CMakeLists.txt
mechanism) would be to wrap this inside a #if LIB_PICO_STDIO_USB
? Would that code need to also explicitly include stdio_usb.h
inside a #if LIB_PICO_STDIO_USB
too?
Or have I grabbed the totally wrong end of the stick? 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you would do exact all that... however the other #define stuff avoids you having to mess with stuff. I did not want to try to shoe-horn connection waiting into the abstraction for stdio drivers atm especially since the UART one is not capable of waiting even though you could detect a UART connection with more pins