Skip to content

Commit c635bcd

Browse files
committed
use esp_random in WMath.cpp
1 parent e1a417a commit c635bcd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: cores/esp32/WMath.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
extern "C" {
2727
#include <stdlib.h>
28+
#include "esp_system.h"
2829
}
2930

3031
void randomSeed(unsigned long seed)
@@ -39,7 +40,7 @@ long random(long howbig)
3940
if(howbig == 0) {
4041
return 0;
4142
}
42-
return rand() % howbig;
43+
return esp_random() % howbig;
4344
}
4445

4546
long random(long howsmall, long howbig)

0 commit comments

Comments
 (0)