Skip to content

Commit

Permalink
add printf support to ESP32/8266 and arduino-pico cores (#873)
Browse files Browse the repository at this point in the history
* add printf support to ESP* and arduino-pico cores
* add ESP32/8266 boards to PlatformIO CI

   Arduino CLI seems to have trouble getting the esp* core that
   corresponds to the fqbn prefix
  • Loading branch information
2bndy5 committed Sep 18, 2022
1 parent fa6a075 commit f91fe7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit f91fe7e

Please sign in to comment.