diff options
author | Damien George <damien.p.george@gmail.com> | 2019-12-13 13:30:44 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-12-13 13:33:40 +1100 |
commit | ba84453f77ed8ce5e8ac128bee80d3923a14e9ad (patch) | |
tree | 9781a8d02e547834ff49beb542ce06176182d0a5 /extmod/modurandom.c | |
parent | 48e9262f550ba8c5ff2d7c48c8f8c7f7e5ccfec6 (diff) |
examples/natmod: Add urandom native module example.
Diffstat (limited to 'extmod/modurandom.c')
-rw-r--r-- | extmod/modurandom.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/extmod/modurandom.c b/extmod/modurandom.c index 2e667570d..e3c7fc7f5 100644 --- a/extmod/modurandom.c +++ b/extmod/modurandom.c @@ -36,8 +36,10 @@ // http://www.literatecode.com/yasmarang // Public Domain +#if !MICROPY_ENABLE_DYNRUNTIME STATIC uint32_t yasmarang_pad = 0xeda4baba, yasmarang_n = 69, yasmarang_d = 233; STATIC uint8_t yasmarang_dat = 0; +#endif STATIC uint32_t yasmarang(void) { @@ -208,6 +210,7 @@ STATIC mp_obj_t mod_urandom___init__() { STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_urandom___init___obj, mod_urandom___init__); #endif +#if !MICROPY_ENABLE_DYNRUNTIME STATIC const mp_rom_map_elem_t mp_module_urandom_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_urandom) }, #ifdef MICROPY_PY_URANDOM_SEED_INIT_FUNC @@ -232,5 +235,6 @@ const mp_obj_module_t mp_module_urandom = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t*)&mp_module_urandom_globals, }; +#endif #endif //MICROPY_PY_URANDOM |