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

Generate warnings if Pico STDIO init called #1467

Merged
merged 2 commits into from
May 24, 2023
Merged

Generate warnings if Pico STDIO init called #1467

merged 2 commits into from
May 24, 2023

Conversation

earlephilhower
Copy link
Owner

Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init, stdio_uart_init) are not supported or needed at compile time. See multiple issues #1433 #1347 #1273 #1251 and others.

@earlephilhower earlephilhower changed the title Generate warnings if Pico SDDIO init called Generate warnings if Pico STDIO init called May 23, 2023
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time.  See multiple
issues #1433 #1347 #1273 #1251 and others.
@earlephilhower
Copy link
Owner Author

Users will get a nice explanatory message and links if they try to call unsupported pico-stdio calls:

In file included from /tmp/arduino_build_841677/sketch/sketch_may23a.ino.cpp:1:
/home/earle/Arduino/sketch_may23a/sketch_may23a.ino: In function 'void setup()':
/home/earle/Arduino/hardware/pico/rp2040/cores/rp2040/Arduino.h:138:44: error: static assertion failed: stdio_init_all is not supported or needed. Either use Serial.printf() or set the debug port in the IDE to Serial/1/2 and use printf().  See https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1540354673 and https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1546783109
  138 | #define stdio_init_all(...)  static_assert(0, "stdio_init_all is not supported or needed. Either use Serial.printf() or set the debug port in the IDE to Serial/1/2 and use printf().  See https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1540354673 and https://github.com/earlephilhower/arduino-pico/issues/1433#issuecomment-1546783109")
      |                                            ^
/home/earle/Arduino/sketch_may23a/sketch_may23a.ino:4:3: note: in expansion of macro 'stdio_init_all'
    4 |   stdio_init_all();
      |   ^~~~~~~~~~~~~~
exit status 1
Error compiling for board Raspberry Pi Pico.

@earlephilhower earlephilhower merged commit e93bd14 into master May 24, 2023
@earlephilhower earlephilhower deleted the sia branch May 24, 2023 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant