summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert <robert@hammelrath.com>2020-08-23 12:12:11 +0200
committerDamien George <damien@micropython.org>2020-10-29 14:12:44 +1100
commit057193e855ca0b5873191c327184052765781ddf (patch)
tree5b5c0d551d4090e742f685726639d915ba884931
parentb4062894df8e17e11179dcb5f5b28b27eed33aff (diff)
esp8266/mpconfigport.h: Seed the urandom module on import.
For seeding, the hardware RNG of the esp8266 is used.
-rw-r--r--ports/esp8266/mpconfigport.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h
index 974310f84..99cf2ade4 100644
--- a/ports/esp8266/mpconfigport.h
+++ b/ports/esp8266/mpconfigport.h
@@ -26,6 +26,7 @@
#define MICROPY_HELPER_REPL (1)
#define MICROPY_HELPER_LEXER_UNIX (0)
#define MICROPY_ENABLE_SOURCE_LINE (1)
+#define MICROPY_MODULE_BUILTIN_INIT (1)
#define MICROPY_MODULE_WEAK_LINKS (1)
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
#define MICROPY_USE_INTERNAL_ERRNO (1)
@@ -69,6 +70,7 @@
#define MICROPY_PY_UTIMEQ (1)
#define MICROPY_PY_UJSON (1)
#define MICROPY_PY_URANDOM (1)
+#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (*WDEV_HWRNG)
#define MICROPY_PY_URE (1)
#define MICROPY_PY_USELECT (1)
#define MICROPY_PY_UTIME_MP_HAL (1)
@@ -197,4 +199,6 @@ extern const struct _mp_obj_module_t mp_module_onewire;
#define MICROPY_WRAP_MP_KEYBOARD_INTERRUPT(f) MP_FASTCODE(f)
#define MICROPY_WRAP_MP_SCHED_SCHEDULE(f) MP_FASTCODE(f)
+#define WDEV_HWRNG ((volatile uint32_t *)0x3ff20e44)
+
#define _assert(expr) ((expr) ? (void)0 : __assert_func(__FILE__, __LINE__, __func__, #expr))