Skip to content

Commit b621de7

Browse files
committed
codal_port/mpconfigport.h: Enable seeding of random module on import.
Signed-off-by: Damien George <[email protected]>
1 parent 6e0273f commit b621de7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/codal_port/mpconfigport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
#define MICROPY_PY_UERRNO (1)
8282
#define MICROPY_PY_UTIME_MP_HAL (1)
8383
#define MICROPY_PY_URANDOM (1)
84+
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (rng_generate_random_word())
8485
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
8586
#define MICROPY_PY_MACHINE (1)
8687
#define MICROPY_PY_MACHINE_PULSE (1)
@@ -156,4 +157,7 @@ typedef long mp_off_t;
156157
// We need to provide a declaration/definition of alloca()
157158
#include <alloca.h>
158159

160+
// Needed for MICROPY_PY_URANDOM_SEED_INIT_FUNC.
161+
extern uint32_t rng_generate_random_word(void);
162+
159163
#endif

0 commit comments

Comments
 (0)