pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Allow disabling pico_stdio function wrapping

Open gemarcano opened this issue 1 year ago • 2 comments

This PR copies the approach used by pico_printf and applies it to pico_stdio to allow a developer to opt out of stdio printf/putchar/etc. wrappers. This is done with the use of a new function pico_set_stdio_implementation which works identically to pico_set_printf_implementation from pico_printf.

This enables a developer to opt out of stdio wrappers around the following functions:

  • printf
  • vprintf
  • puts
  • putchar
  • getchar

Additionally, in pico_stdio's stdio.c, some additional #if/#endif are applied to shut up compiler warnings about unused functions when pico_printf compiler implementation is in use.

Fixes #1634

gemarcano avatar Feb 14 '24 22:02 gemarcano

Looks reasonable as far as I can see

peterharperuk avatar Feb 15 '24 10:02 peterharperuk

I noticed a useless newline I added in stdio.c, so I just took that out. No other changes with the update.

gemarcano avatar Feb 15 '24 19:02 gemarcano