Skip to content

Conversation

kilograham
Copy link
Contributor

  • 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
@kilograham
Copy link
Contributor Author

fixes #527
fixes #224

*
* \return true if stdio is connected over CDC
*/
bool stdio_usb_connected(void);
Copy link
Contributor

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? 🙃

Copy link
Contributor Author

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

@kilograham kilograham merged commit 13be546 into develop Oct 8, 2021
@kilograham kilograham deleted the stdio_improvements branch October 8, 2021 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants