diff options
Diffstat (limited to 'esp8266/modpyb.c')
-rw-r--r-- | esp8266/modpyb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/esp8266/modpyb.c b/esp8266/modpyb.c index be7415e68..d72ee79f0 100644 --- a/esp8266/modpyb.c +++ b/esp8266/modpyb.c @@ -149,6 +149,12 @@ STATIC mp_obj_t pyb_hard_reset(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_hard_reset_obj, pyb_hard_reset); +STATIC mp_obj_t pyb_unique_id(void) { + uint32_t id = system_get_chip_id(); + return mp_obj_new_bytes((byte *)&id, sizeof(id)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_unique_id_obj, pyb_unique_id); + STATIC const mp_map_elem_t pyb_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_pyb) }, |