diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-22 13:41:02 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-22 13:41:02 +0000 |
commit | 684164a8cf8c2b989049d964ca7fc0419ada31ab (patch) | |
tree | 9322421223707316c600e5652a8c78312ea10342 /stmhal/pybmodule.c | |
parent | 2fb37847a712127543c879cd4c925ac4ee3c8554 (diff) | |
download | micropython-684164a8cf8c2b989049d964ca7fc0419ada31ab.tar.gz micropython-684164a8cf8c2b989049d964ca7fc0419ada31ab.zip |
stmhal: Add PYBv10 config; add RNG support.
Diffstat (limited to 'stmhal/pybmodule.c')
-rw-r--r-- | stmhal/pybmodule.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/stmhal/pybmodule.c b/stmhal/pybmodule.c index 3db23dc6de..afb3b2e60e 100644 --- a/stmhal/pybmodule.c +++ b/stmhal/pybmodule.c @@ -17,6 +17,7 @@ #include "pin.h" #include "exti.h" #include "usrsw.h" +#include "rng.h" #include "rtc.h" #include "usart.h" #include "storage.h" @@ -128,16 +129,6 @@ STATIC mp_obj_t pyb_udelay(mp_obj_t usec) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_udelay_obj, pyb_udelay); -STATIC mp_obj_t pyb_rng_get(void) { -#if 0 - return mp_obj_new_int(RNG_GetRandomNumber() >> 16); -#else - return mp_obj_new_int(0); -#endif -} - -STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_rng_get_obj, pyb_rng_get); - #if 0 STATIC void SYSCLKConfig_STOP(void) { /* After wake-up from STOP reconfigure the system clock */ @@ -232,7 +223,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_sync), (mp_obj_t)&pyb_sync_obj }, #if MICROPY_HW_ENABLE_RNG - { MP_OBJ_NEW_QSTR(MP_QSTR_rand), (mp_obj_t)&pyb_rng_get_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_rng), (mp_obj_t)&pyb_rng_get_obj }, #endif #if MICROPY_HW_ENABLE_RTC |