Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
622f2413
Commit
622f2413
authored
May 29, 2015
by
Daniel Campora
Browse files
cc3200: Rename pyb.reset() to pyb.hard_reset() and add pyb.unique_id().
parent
286ced4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
cc3200/mods/modpyb.c
View file @
622f2413
...
...
@@ -130,6 +130,15 @@ STATIC mp_obj_t pyb_freq(void) {
}
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()
/// 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
[]
=
{
{
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
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_info
),
(
mp_obj_t
)
&
pyb_info_obj
},
#endif
{
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_uart
),
(
mp_obj_t
)
&
pyb_repl_uart_obj
},
...
...
cc3200/qstrdefsport.h
View file @
622f2413
...
...
@@ -30,7 +30,7 @@ Q(__name__)
Q
(
help
)
Q
(
pyb
)
Q
(
info
)
Q
(
reset
)
Q
(
hard_
reset
)
Q
(
main
)
Q
(
sync
)
Q
(
gc
)
...
...
@@ -48,6 +48,7 @@ Q(readline)
Q
(
input
)
Q
(
os
)
Q
(
freq
)
Q
(
unique_id
)
Q
(
repl_info
)
Q
(
disable_irq
)
Q
(
enable_irq
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment