Merge pull request #2957 from cesanta/picornd

Use Pico-SDK RNG
This commit is contained in:
Sergio R. Caprile authored and GitHub committed 2024-11-07 11:59:47 -03:00
commit 7a30a42797
8 files changed
+12 -4

No files matched your search

+3
View File
@@ -16784,6 +16784,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