Use Pico-SDK RNG

This commit is contained in:
Sergio R. Caprile committed 2024-11-07 11:57:08 -03:00
1 parent 5559d0fa68
commit 094202ff16
8 files changed
+12 -4

No files matched your search

+3
View File
@@ -17,6 +17,9 @@ bool mg_random(void *buf, size_t len) {
#if MG_ARCH == MG_ARCH_ESP32
while (len--) *p++ = (unsigned char) (esp_random() & 255);
success = true;
#elif MG_ARCH == MG_ARCH_RP2040
while (len--) *p++ = (unsigned char) (get_rand_32() & 255);
success = true;
#elif MG_ARCH == MG_ARCH_WIN32
static bool initialised = false;
#if defined(_MSC_VER) && _MSC_VER < 1700