You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because this repo is now using the std:;min std::max functions instead of #defines. This gives the hint:
error: no matching function for call to 'min(uint16_t&, int)'
val = min(val, 4095);
^
So val is uint16_t while 4095 is int, and comparing those two types implicitly is a no-no. This is precisely why the C++ standard implemented the std::min|max templated functions.
The correct way would be to do one of:
declare val as int instead of uint16_t
cast val to int explicitly when passing the arg (e.g.: min((int)val, 4095)
cast 4095 to uint16_t when passing the arg (e.g.: min(val, (uint16_t)4095) )
declare a static const uint16_t somename = 4095 and use somename as arg
I suggest opening an issue in their repo asking that they fix their code.
Basic Infos
Hardware
Hardware: NodeMCU 1.0 ESP-12E
Core Version: 2.4.0
Description
Can't compile using Core Version: 2.4.0
But it compiles without any problem using core version: 2.4.0-rc2 or core version: 2.3.0
Settings in IDE
Module: NodeMCU 1.0 ESP-12E
Flash Size: 4MB
CPU Frequency: 160Mhz
Flash Mode: ?qio?
Flash Frequency: ?40Mhz?
Upload Using: ?OTA / SERIAL?
Reset Method: ?ck / nodemcu?
Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: