rogerclarkmelbourne / Arduino_STM32

Arduino STM32. Hardware files to support STM32 boards, on Arduino IDE 1.8.x including LeafLabs Maple and other generic STM32F103 boards
Other
2.49k stars 1.25k forks source link

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

Closed ArminJo closed 1 year ago

ArminJo commented 1 year ago

Standard Arduino programs do not compile if they userandom();

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?

rogerclarkmelbourne commented 1 year ago

Where is random() implemented ?

ArminJo commented 1 year ago

??? long random(long howbig= __LONG_MAX__); introduces a default/optional parameter.

long random(long howbig) is implemented here

rogerclarkmelbourne commented 1 year ago

Create a PR and I will merge it, as I think its a low risk change

ArminJo commented 1 year ago

Done!

rogerclarkmelbourne commented 1 year ago

Thanks

ArminJo commented 1 year ago

Thank YOU for maintaining this core 🥇 .

ArminJo commented 3 months ago

@stevestrong @rogerclarkmelbourne Is there any reason, why the PR is not merged now?

stevstrong commented 3 months ago

which PR?

ArminJo commented 3 months ago

Sorry I had "Tomaten auf den Augen". it was PR https://github.com/rogerclarkmelbourne/Arduino_STM32/pull/889. I was searching for it in order to delete my local fork and I have not found it, since I looked at the wrong place. Thanks again for maintaining!