You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having issues with moving the Arduino code with the Example01_Basic_OneShot to PlatformIO because of a library confict/compilation error in that environment.
The SparkFun Toolkit Library fails to compile under PlatformIO for ESP32-based boards due to the use of LookaheadMode, which is not declared or defined in PlatformIO's Arduino framework environment.
The same code compiles successfully in the Arduino IDE.
Compilation Errors
Header Declaration Issues
lib/SparkFun_Toolkit/src/sfTkArdUART.h:266:19: error: 'LookaheadMode' has not been declared
longparseInt(LookaheadMode lookahead = LookaheadMode::SKIP_ALL, char ignore = NO_IGNORE_CHAR);
Source File Errors
lib/SparkFun_Toolkit/src/sfTkArdUART.cpp:354:28: error: 'long int sfTkArdUART::parseInt' is not a static data member of 'class sfTkArdUART'longsfTkArdUART::parseInt(LookaheadMode lookahead, char ignore)
Additionally, calls to _hwSerial->find(const uint8_t*) fail due to invalid overload resolution:
error: no matching function for call to 'find(const uint8_t*&)'
Notes
This project uses the AS7331 UV sensor via the SparkFun Arduino Library.
The issues appear to be tied to the use of Arduino's Stream class and related helpers (LookaheadMode) that are handled differently (or omitted) in PlatformIO's framework package.
Workaround attempts such as manually redefining LookaheadMode or casting const uint8_t* to char* are not viable across the whole library and break compatibility.
Reproduction Steps
Create a PlatformIO project targeting lolin_d32 (or likely any ESP32 chip)
Add SparkFun AS7331 Arduino Library and SparkFun Toolkit as dependencies
Include a basic sketch using SfeAS7331ArdI2C
Compile the project
Observe the parsing and type errors originating from sfTkArdUART.h and .cpp
Expected Behavior
The code should compile under PlatformIO, matching the success observed in the Arduino IDE.
The text was updated successfully, but these errors were encountered:
Having issues with moving the Arduino code with the Example01_Basic_OneShot to PlatformIO because of a library confict/compilation error in that environment.
Environment
Summary
The SparkFun Toolkit Library fails to compile under PlatformIO for ESP32-based boards due to the use of
LookaheadMode
, which is not declared or defined in PlatformIO's Arduino framework environment.The same code compiles successfully in the Arduino IDE.
Compilation Errors
Header Declaration Issues
Source File Errors
Additionally, calls to
_hwSerial->find(const uint8_t*)
fail due to invalid overload resolution:Notes
Stream
class and related helpers (LookaheadMode
) that are handled differently (or omitted) in PlatformIO's framework package.LookaheadMode
or castingconst uint8_t*
tochar*
are not viable across the whole library and break compatibility.Reproduction Steps
lolin_d32
(or likely any ESP32 chip)SfeAS7331ArdI2C
sfTkArdUART.h
and.cpp
Expected Behavior
The code should compile under PlatformIO, matching the success observed in the Arduino IDE.
The text was updated successfully, but these errors were encountered: