Allow disabling pico_stdio function wrapping #1635

Closed
gemarcano wants to merge 1 commit from enable_stdio_wrap_disable into develop
gemarcano commented 2024-02-14 16:35:34 -06:00 (Migrated from github.com)

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

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
kilograham (Migrated from github.com) reviewed 2024-02-14 16:35:34 -06:00
peterharperuk commented 2024-02-15 04:56:43 -06:00 (Migrated from github.com)

Looks reasonable as far as I can see

Looks reasonable as far as I can see
gemarcano commented 2024-02-15 13:00:51 -06:00 (Migrated from github.com)

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

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

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!1635
No description provided.