mxtommy / SigkSens

ESP8266 based SignalK Wifi Sensors
Apache License 2.0
38 stars 8 forks source link

LED_BUILTIN isn't defined for ESP32 #68

Closed ba58smith closed 5 years ago

ba58smith commented 5 years ago

From my summary of the getting SigkSens to work with ESP32:

  1. SigkSens has (I think) three references to LED_BUILTIN, which isn't defined for the ESP32. Need to deal with that. (config.h, and 2 in configReset.cpp).

I didn't see that anyone fixed this, so it's still an issue, I think.

ba58smith commented 5 years ago

Update: I think that some esp32 boards define LED_BUILTIN and some don't. So, looks like we need something like this, in config.h, maybe? Or does it need to be one of the last #includes in sigksens.ino, so that it will be user-defined only if it's not been defined by the particular board? (I don't know where the specific board's #define statements come in, but this one should be after that, I believe.)

#ifndef LED_BUILTIN
#define LED_BUILTIN 13 // pin number is specific to your esp32 board
#endif
ba58smith commented 5 years ago

Well, that won't work, at least for my Heltec Wifi Kit 32 with the built-in screen. It has this in one of its board definition files: static const uint8_t LED_BUILTIN = 25;. So I can't #define LED_BUILTIN x because I guess #ifndef doesn't know that LED_BUILTIN has already been used as a constant variable. Is there another way for me to detect that LED_BUILTIN has already been used, but not with a #define?

mxtommy commented 5 years ago

merged #69 :) That works fine :)

Thanks!