Skip to content
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

Allow disabling pico_stdio function wrapping #1635

Closed

Conversation

gemarcano
Copy link

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 added a commit to gemarcano/snes_controllers_to_usb that referenced this pull request Feb 15, 2024
 - Software is based off my wifi pc remote button code, as well as my
   old SNES STM32 controller converter code for the TinyUSB descriptor.
 - This code relies on the following upstream PRs:
   - raspberrypi/pico-sdk#1530
   - FreeRTOS/FreeRTOS-Kernel#991
   - raspberrypi/pico-sdk#1635
@peterharperuk
Copy link
Contributor

Looks reasonable as far as I can see

@gemarcano
Copy link
Author

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

 - Copy the approach used by pico_printf and apply it to pico_stdio to
   allow a developer to opt out of stdio printf/putchar/etc. wrappers.
 - Add some #if/#endif around some functions that are not used if
   PICO_PRINTF_PICO isn't 1 to stop compiler warnings about unused
   functions.
@kilograham kilograham self-assigned this Jul 21, 2024
@kilograham kilograham modified the milestones: 1.6.1, 1.6.2 Jul 22, 2024
@kilograham kilograham modified the milestones: 1.6.2, 2.0.0 Aug 8, 2024
@kilograham kilograham closed this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants