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
The STM32 BSP uses the following code for min/max:
In cores\arduino\wiring_constants.h, lines 24 ff:
#ifdef __cplusplus
#include<algorithm>using std::min;
using std::max;
#else// C
...
Unfortunately, with the version of the compiler and libraries that we use, this causes things like the Adafruit ePaper Display Library not to compile, with cryptic warnings related to iterators pointing at uses of min and max. Comparing to other BSPs, I found that the Arduino.cc H7 BSP provides its own implementation:
In cores\arduino\api\Common.h, lines 122 ff:
#ifdef __cplusplus
template<classT, classL>
automin(const T& a, const L& b) -> decltype((b < a) ? b : a)
{
return (b < a) ? b : a;
}
template<classT, classL>
automax(const T& a, const L& b) -> decltype((b < a) ? b : a)
{
return (a < b) ? b : a;
}
#else
...
This (and the Adafruit/MCCI SAMD BSP, which just #definemin() and max()) compile the Adafruit libraries without difficulty.
Patching the STM32 BSP with the code from the H7 BSP solves the problem.
The text was updated successfully, but these errors were encountered:
The STM32 BSP uses the following code for min/max:
In
cores\arduino\wiring_constants.h
, lines 24 ff:Unfortunately, with the version of the compiler and libraries that we use, this causes things like the Adafruit ePaper Display Library not to compile, with cryptic warnings related to iterators pointing at uses of
min
andmax
. Comparing to other BSPs, I found that the Arduino.cc H7 BSP provides its own implementation:In
cores\arduino\api\Common.h
, lines 122 ff:This (and the Adafruit/MCCI SAMD BSP, which just
#define
min()
andmax()
) compile the Adafruit libraries without difficulty.Patching the STM32 BSP with the code from the H7 BSP solves the problem.
The text was updated successfully, but these errors were encountered: