This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 30
30
#include "modpyb.h"
31
31
#include "ff.h"
32
32
33
+ STATIC mp_obj_t pyb_unique_id (void ) {
34
+ // get unique id; 96 bits
35
+ byte * id = (byte * )0x1fff7a10 ;
36
+ return mp_obj_new_bytes (id , 12 );
37
+ }
38
+ STATIC MP_DEFINE_CONST_FUN_OBJ_0 (pyb_unique_id_obj , pyb_unique_id );
39
+
33
40
// get lots of info about the board
34
41
STATIC mp_obj_t pyb_info (uint n_args , const mp_obj_t * args ) {
35
42
// get and print unique id; 96 bits
@@ -233,6 +240,7 @@ MP_DECLARE_CONST_FUN_OBJ(pyb_usb_mode_obj); // defined in main.c
233
240
STATIC const mp_map_elem_t pyb_module_globals_table [] = {
234
241
{ MP_OBJ_NEW_QSTR (MP_QSTR___name__ ), MP_OBJ_NEW_QSTR (MP_QSTR_pyb ) },
235
242
243
+ { MP_OBJ_NEW_QSTR (MP_QSTR_unique_id ), (mp_obj_t )& pyb_unique_id_obj },
236
244
{ MP_OBJ_NEW_QSTR (MP_QSTR_info ), (mp_obj_t )& pyb_info_obj },
237
245
{ MP_OBJ_NEW_QSTR (MP_QSTR_gc ), (mp_obj_t )& pyb_gc_obj },
238
246
{ MP_OBJ_NEW_QSTR (MP_QSTR_repl_info ), (mp_obj_t )& pyb_set_repl_info_obj },
Original file line number Diff line number Diff line change 2
2
3
3
Q (help )
4
4
Q (pyb )
5
+ Q (unique_id )
5
6
Q (info )
6
7
Q (sd_test )
7
8
Q (present )
You can’t perform that action at this time.
0 commit comments