|
@ -130,6 +130,15 @@ STATIC mp_obj_t pyb_freq(void) { |
|
|
} |
|
|
} |
|
|
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_freq_obj, pyb_freq); |
|
|
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_freq_obj, pyb_freq); |
|
|
|
|
|
|
|
|
|
|
|
/// \function unique_id()
|
|
|
|
|
|
/// Returns a string of 6 bytes (48 bits), which is the unique ID for the MCU.
|
|
|
|
|
|
STATIC mp_obj_t pyb_unique_id(void) { |
|
|
|
|
|
uint8_t mac[SL_BSSID_LENGTH]; |
|
|
|
|
|
wlan_get_mac (mac); |
|
|
|
|
|
return mp_obj_new_bytes(mac, SL_BSSID_LENGTH); |
|
|
|
|
|
} |
|
|
|
|
|
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_unique_id_obj, pyb_unique_id); |
|
|
|
|
|
|
|
|
/// \function millis()
|
|
|
/// \function millis()
|
|
|
/// Returns the number of milliseconds since the board was last reset.
|
|
|
/// Returns the number of milliseconds since the board was last reset.
|
|
|
///
|
|
|
///
|
|
@ -241,11 +250,12 @@ MP_DECLARE_CONST_FUN_OBJ(pyb_main_obj); // defined in main.c |
|
|
STATIC const mp_map_elem_t pyb_module_globals_table[] = { |
|
|
STATIC const mp_map_elem_t pyb_module_globals_table[] = { |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_pyb) }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_pyb) }, |
|
|
|
|
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_reset), (mp_obj_t)&pyb_hard_reset_obj }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_hard_reset), (mp_obj_t)&pyb_hard_reset_obj }, |
|
|
#ifdef DEBUG |
|
|
#ifdef DEBUG |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, |
|
|
#endif |
|
|
#endif |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_freq), (mp_obj_t)&pyb_freq_obj }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_freq), (mp_obj_t)&pyb_freq_obj }, |
|
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_unique_id), (mp_obj_t)&pyb_unique_id_obj }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_repl_info), (mp_obj_t)&pyb_set_repl_info_obj }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_repl_info), (mp_obj_t)&pyb_set_repl_info_obj }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_repl_uart), (mp_obj_t)&pyb_repl_uart_obj }, |
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_repl_uart), (mp_obj_t)&pyb_repl_uart_obj }, |
|
|
|
|
|
|
|
|