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

add printf support to ESP32/8266 and arduino-pico cores #873

Merged
merged 2 commits into from
Sep 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build_platformIO.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ jobs:
- "teensylc"
- "genericSTM32F411CE"
- "blackpill_f103c8"
- "nodemcuv2"
- "adafruit_qtpy_esp32s2"

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 7 additions & 1 deletion RF24_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,18 @@ extern HardwareSPI SPI;
#endif // defined (__ARDUINO_X86__)

// Progmem is Arduino-specific
#if defined(ARDUINO_ARCH_ESP8266) || defined(ESP32)
#if defined(ARDUINO_ARCH_ESP8266) || defined(ESP32) || (defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED))
#include <pgmspace.h>
#define PRIPSTR "%s"
#ifndef pgm_read_ptr
#define pgm_read_ptr(p) (*(void* const*)(p))
#endif
// Serial.printf() is no longer defined in the unifying Arduino/ArduinoCore-API repo
// Serial.printf() is defined if using the arduino-pico/esp32/8266 repo
#if defined(ARDUINO_ARCH_ESP32) // do not `undef` when using the espressif SDK only
#undef printf_P // needed for ESP32 core
#endif
#define printf_P Serial.printf
#elif defined(ARDUINO) && !defined(ESP_PLATFORM) && !defined(__arm__) && !defined(__ARDUINO_X86__) || defined(XMEGA)
#include <avr/pgmspace.h>
#define PRIPSTR "%S"
Expand Down