|
16 | 16 | #include "hal/include/hal_rand_sync.h" |
17 | 17 | #endif |
18 | 18 |
|
19 | | -static const qstr os_uname_info_fields[] = { |
20 | | - MP_QSTR_sysname, MP_QSTR_nodename, |
21 | | - MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine |
22 | | -}; |
23 | | -#ifdef SAMD21 |
24 | | -static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd21"); |
25 | | -static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd21"); |
26 | | -#endif |
27 | | -#ifdef SAM_D5X_E5X |
28 | | -static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd51"); |
29 | | -static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd51"); |
30 | | -#endif |
31 | | -static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); |
32 | | -static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); |
33 | | -static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME); |
34 | | - |
35 | | - |
36 | | -static MP_DEFINE_ATTRTUPLE( |
37 | | - os_uname_info_obj, |
38 | | - os_uname_info_fields, |
39 | | - 5, |
40 | | - (mp_obj_t)&os_uname_info_sysname_obj, |
41 | | - (mp_obj_t)&os_uname_info_nodename_obj, |
42 | | - (mp_obj_t)&os_uname_info_release_obj, |
43 | | - (mp_obj_t)&os_uname_info_version_obj, |
44 | | - (mp_obj_t)&os_uname_info_machine_obj |
45 | | - ); |
46 | | - |
47 | | -mp_obj_t common_hal_os_uname(void) { |
48 | | - return (mp_obj_t)&os_uname_info_obj; |
49 | | -} |
50 | | - |
51 | 19 | bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) { |
52 | 20 | #ifdef SAM_D5X_E5X |
53 | 21 | hri_mclk_set_APBCMASK_TRNG_bit(MCLK); |
|
0 commit comments