Arduino_STM32 icon indicating copy to clipboard operation
Arduino_STM32 copied to clipboard

random() without parameter like in standard Arduino API is missing.

Open ArminJo opened this issue 3 years ago • 0 comments

Standard Arduino programs do not compile if they use random();

E.g.

/home/runner/Arduino/libraries/NeoPatterns/src/NeoPatterns.hpp:1474:31: error: no matching function for call to 'random()'
         tRandom.Long = random();
                               ^
/home/runner/Arduino/libraries/NeoPatterns/src/NeoPatterns.hpp:1474:31: note: candidates are:
...
/home/runner/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:50:6: note: long int random(long int)
 long random(long max);

if I replace the line 50 in wirish_math.h long random(long max); with long random(long max = __LONG_MAX__); everything works fine.

Do you require a PR?

ArminJo avatar Aug 07 '22 12:08 ArminJo