From 49f35ff070fcb8c82a11866ae6f81bab49dba6e3 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Fri, 2 Dec 2016 13:42:31 +0200 Subject: [PATCH] use esp_random in WMath.cpp --- cores/esp32/WMath.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cores/esp32/WMath.cpp b/cores/esp32/WMath.cpp index fef0e94b..b1099b67 100644 --- a/cores/esp32/WMath.cpp +++ b/cores/esp32/WMath.cpp @@ -25,6 +25,7 @@ extern "C" { #include +#include "esp_system.h" } void randomSeed(unsigned long seed) @@ -39,7 +40,7 @@ long random(long howbig) if(howbig == 0) { return 0; } - return rand() % howbig; + return esp_random() % howbig; } long random(long howsmall, long howbig)