I get curious compile errors I don’t understand when I include OneWire.h .
This is on a 2 month old install of the Arduino IDE & Heltec parts.
Sketches using this worked on older versions of the IDE & Board definitions & libraries.
----Versions
Arduino IDE 2.3.2
Boards:
“Heltec ESP32 Series Dev-boards” 3.0.2
Libraries:
“Heltec ESP32 Dev-Boards” 2.1.1
“OneWire” 2.3.8
Board selected: WiFi LoRa 32(V2)
----Stripped down sample sketch:
#include <arduino.h>
#include <heltec.h>
#include <OneWire.h>
void setup() {
// nothing yet
}
void loop() {
// nothing yet
}
----Compile messages:
Library Heltec ESP32 Dev-Boards has been declared precompiled:
Using precompiled library in c:\Users\Lee\Documents\Arduino\libraries\Heltec_ESP32_Dev-Boards\src\esp32
In file included from C:\Users\Lee\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal.h:75,
from C:\Users\Lee\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/Arduino.h:36,
from c:\Users\Lee\Documents\Arduino\libraries\OneWire\OneWire.cpp:147:
c:\Users\Lee\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function ‘void directModeInput(uint32_t)’:
C:\Users\Lee\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal-gpio.h:67:34: error: ‘GPIO_IS_VALID_GPIO’ was not declared in this scope; did you mean ‘RTC_GPIO_IS_VALID_GPIO’?
67 | #define digitalPinIsValid(pin) GPIO_IS_VALID_GPIO(pin)
| ^~~~~~~~~~~~~~~~~~
c:\Users\Lee\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:214:10: note: in expansion of macro ‘digitalPinIsValid’
214 | if ( digitalPinIsValid(pin) )
| ^~~~~~~~~~~~~~~~~
c:\Users\Lee\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function ‘void directModeOutput(uint32_t)’:
C:\Users\Lee\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal-gpio.h:67:34: error: ‘GPIO_IS_VALID_GPIO’ was not declared in this scope; did you mean ‘RTC_GPIO_IS_VALID_GPIO’?
67 | #define digitalPinIsValid(pin) GPIO_IS_VALID_GPIO(pin)
| ^~~~~~~~~~~~~~~~~~
c:\Users\Lee\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:240:10: note: in expansion of macro ‘digitalPinIsValid’
240 | if ( digitalPinIsValid(pin) && pin <= 33 ) // pins above 33 can be only inputs
| ^~~~~~~~~~~~~~~~~
exit status 1