File tree 3 files changed +13
-2
lines changed 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,17 @@ void mp_unix_mark_exec(void);
253
253
#define MICROPY_FORCE_PLAT_ALLOC_EXEC (1)
254
254
#endif
255
255
256
+ #ifdef MICROPY_PY_URANDOM_SEED_INIT_FUNC
257
+ // Support for seeding the random module on import.
258
+ #include <stddef.h>
259
+ void mp_hal_get_random (size_t n , void * buf );
260
+ static inline unsigned long mp_urandom_seed_init (void ) {
261
+ unsigned long r ;
262
+ mp_hal_get_random (sizeof (r ), & r );
263
+ return r ;
264
+ }
265
+ #endif
266
+
256
267
#ifdef __linux__
257
268
// Can access physical memory using /dev/mem
258
269
#define MICROPY_PLAT_DEV_MEM (1)
Original file line number Diff line number Diff line change 31
31
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
32
32
33
33
// Disable some features that come enabled by default with the feature level.
34
- #define MICROPY_MODULE_BUILTIN_INIT (0)
35
34
#define MICROPY_PY_BUILTINS_EXECFILE (0)
36
35
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
37
36
#define MICROPY_PY_USELECT (0)
50
49
#define MICROPY_PY_SYS_GETSIZEOF (1)
51
50
#define MICROPY_PY_SYS_TRACEBACKLIMIT (1)
52
51
#define MICROPY_PY_IO_BUFFEREDWRITER (1)
52
+ #define MICROPY_PY_URANDOM_SEED_INIT_FUNC (mp_urandom_seed_init())
53
53
#define MICROPY_PY_URE_DEBUG (1)
54
54
#define MICROPY_PY_URE_MATCH_GROUPS (1)
55
55
#define MICROPY_PY_URE_MATCH_SPAN_START_END (1)
Original file line number Diff line number Diff line change 28
28
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
29
29
30
30
// Disable some features that come enabled by default with the feature level.
31
- #define MICROPY_MODULE_BUILTIN_INIT (0)
32
31
#define MICROPY_PY_BUILTINS_EXECFILE (0)
33
32
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
34
33
#define MICROPY_PY_USELECT (0)
37
36
#define MICROPY_REPL_EMACS_WORDS_MOVE (1)
38
37
#define MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE (1)
39
38
#define MICROPY_PY_SYS_SETTRACE (1)
39
+ #define MICROPY_PY_URANDOM_SEED_INIT_FUNC (mp_urandom_seed_init())
You can’t perform that action at this time.
0 commit comments