Skip to content

Library fails to compile against Arduino Nano ESP32 #29

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

Open
sniper1651 opened this issue Jul 9, 2024 · 1 comment
Open

Library fails to compile against Arduino Nano ESP32 #29

sniper1651 opened this issue Jul 9, 2024 · 1 comment

Comments

@sniper1651
Copy link

When using V3.0.5 of the library (included using the IDE package manage) compiling a sketch with the SX1509 library using the Arduino Nano ESP32 as the selected board it fails to compile with the following errors:

C:\<PATH>\Arduino\libraries\SX1509_IO_Expander\src/SparkFunSX1509.h:130:70: error: macro "pinMode" passed 3 arguments, but takes just 2
  void pinMode(uint8_t pin, uint8_t inOut, uint8_t initialLevel = HIGH);

C:\<PATH>\Arduino\libraries\SX1509_IO_Expander\src/SparkFunSX1509.h:156:43: error: macro "digitalRead" passed 2 arguments, but takes just 1
  bool digitalRead(uint8_t pin, bool *value);

Changing the board to Arduino Nano or Arduino Nano Every compiles correctly.

@sniper1651
Copy link
Author

I have spent some more time on this, and if I rename the pinMode function to pinMode2 and the digitalRead to digitalRead2 in the .h and .cpp files it compiles and works, so for some reason when compiling under Nano ESP32 it seems to get confused between the native pinMode and the SX1509.pinMode definitions. Yet it compiles without issues under AVR for a Nano or Nano Every.

Could there be an error in the SparkFunSX1509.h file that causes the confusion within the compiler?

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

No branches or pull requests

1 participant