ArduinoDuPPaLib icon indicating copy to clipboard operation
ArduinoDuPPaLib copied to clipboard

LEDRing issue with ESP32

Open skibum-za opened this issue 5 years ago • 3 comments

Just tried to compile up the demo for the LEDRing on my ESP32. It fails with :-

Arduino: 1.8.12 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None" In file included from C:\Users\ajm1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/esp32-hal.h:53:0, from C:\Users\ajm1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:35, from sketch\Demo.ino.cpp:1: C:\Users\ajm1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/esp32-hal-gpio.h:35:27: error: expected unqualified-id before numeric constant #define PULLUP 0x04 ^ `C:\Users\ajm1\Documents\Arduino\libraries\ArduinoDuPPaLib-master\src/LEDRing.h:56:10: note: in expansion of macro 'PULLUP'` ` void PULLUP(uint8_t pull);` ` ^` C:\Users\ajm1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/esp32-hal-gpio.h:37:27: error: expected unqualified-id before numeric constant #define PULLDOWN 0x08 ^ `C:\Users\ajm1\Documents\Arduino\libraries\ArduinoDuPPaLib-master\src/LEDRing.h:57:10: note: in expansion of macro 'PULLDOWN'` ` void PULLDOWN(uint8_t pull);` ` ^` C:\Users\ajm1\AppData\Local\Temp\arduino_modified_sketch_714030\Demo.ino: In function 'void setup()': `C:\Users\ajm1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/esp32-hal-gpio.h:35:27: error: expected unqualified-id before numeric constant` ` #define PULLUP 0x04` ` ^` C:\Users\ajm1\AppData\Local\Temp\arduino_modified_sketch_714030\Demo.ino:36:11: note: in expansion of macro 'PULLUP' LEDRing.PULLUP(0b111); // 32k pull-up resistor for avoid ghost effect ^ `C:\Users\ajm1\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/esp32-hal-gpio.h:37:27: error: expected unqualified-id before numeric constant` #define PULLDOWN 0x08 ^ `C:\Users\ajm1\AppData\Local\Temp\arduino_modified_sketch_714030\Demo.ino:37:11: note: in expansion of macro 'PULLDOWN'` ` LEDRing.PULLDOWN(0b111); // 32k pull-down resistor for avoid ghost effect` ` ^` exit status 1 Error compiling for board ESP32 Dev Module.

It seenms that both PULLUP and PULLDOWN are used as part of the ESP32 core functionality.

I changed the LEDRing.h and LEDRing.cpp to use LRPULLDOWN/LRPULLUP and changed the demo code to then use those and it compiled and worked perfectly. I'm not sure that's a good fix however. But works for now.

skibum-za avatar Jun 22 '20 13:06 skibum-za

Thank you for finding the issue! I will work on it

DuPPadotnet avatar Nov 06 '20 18:11 DuPPadotnet

Same here! thanks!!!

for now I changed PULLUP to PULL_UP and PULLDOWN to PULL_DOWN in both LEDRing.cpp and LEDRing.h, and in the project i am working on. works perfect.

edit: skibum had the same insight :)

emielskey avatar Nov 09 '20 20:11 emielskey

Hello, I have soled the issue, please check! I have also added the library explanation Thank you!

DuPPadotnet avatar Nov 14 '20 16:11 DuPPadotnet