Closed bill-orange closed 5 years ago
@bill-orange are you sure ESP8266
is not defined?
#undef ESP8266
Just because you defined ESP32
doesn't mean ESP8266
wasn't defined somewhere else.
Chuck.
I added #undef ESP8266
and that seemed to do the trick, so far. So, the compiler will pick up definitions from libraries in #include? I will leave this open until I have done enough testing to know if everything works. There might be followup questions.
P.S. I did not know that there was an #undef
Define can also come from cmdline.
esp32 definitely does not define 8266 anywhere. You failed to properly fill the issue form, so I have no idea what versions and software you are running.
@me-no-dev
No worries, @stickbreaker answered my question and all is well now. I was trying to use #ifdef to define chipset and unbeknownst to be one one of the libraries I was including defined ESP8266 causing my ESP32 code not to compile. Adding #undef ESP8266
to my ESP32 code fixed the problem. Complicating the issue, I did not know that #undef
existed. I think on this basis I can close this now.
I am programming an ESP32 using the Arduino IDE with a fairly lengthy sketch. I have a second version of the sketch written to run on an EPS8266. Maintaining two versions of the same sketch is awkward to say the least. I decided it was probably best to merge the two sketches by defining the processor and using #ifdef / #elif, etc throughout the code.
I can not get it to behave as I expected. I don't know if this is a bug or I am doing something wrong that should be obvious.
Compiler errors indicate that the include statements above the #elif are included.
Thoughts?