Ran into problems with the min and max function using ESP8266WiFi.h
Arduino 1.6.4, Feather Huzzah, ESP package 2.0.0
The sketch compiles; but not when ESP8266WiFi.h library is included. It returned ‘min’ was not declared in this scope.
I thought I found a fix by adding #define min(X, Y) (((X)<(Y))?(X):(Y)) #define max(X, Y) (((X)>(Y))?(X):(Y))
When I use the function
RIGHT_PEAK = max(RIGHT_MAX, 0);
leds [RIGHT_PEAK] = CRGB::Red;
it crashes and resets:
Exception (9):
epc1=0x40206ee4 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000015 depc=0x00000000
@Daniel_Garcia NUM_LEDS = 144, I tried all ESP-versions from 1.6, 2.0, 2.1, 2.2, also tried it with Arduino 1.6.8
The problem is not FastLED. ESP2.x does not support min and max and the moment
the library ESP8266WiFi.h is included it will disable this function also in Arduino.
Is it possible to fix the problem in the FastLED ESP8266 support?
Not sure why you want FastLED to fix the platform not defining min/max - especially since FastLED doesn’t use min/max? Also - I’d need to see your entire code to figure out why you are getting that crash - my guess is you’re writing outside of your array somewhere.
@Daniel_Garcia good point, I was just hoping. When I get back I’ll try to debug myself. It’s right now a 2000+ lines monster; I don’t think you want to go through that