File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868/// dac = DAC(1)
6969/// dac.write_timed(buf, 400 * len(buf), mode=DAC.CIRCULAR)
7070
71+ #if MICROPY_HW_ENABLE_DAC
72+
7173STATIC DAC_HandleTypeDef DAC_Handle ;
7274
7375void dac_init (void ) {
@@ -354,3 +356,5 @@ const mp_obj_type_t pyb_dac_type = {
354356 .make_new = pyb_dac_make_new ,
355357 .locals_dict = (mp_obj_t )& pyb_dac_locals_dict ,
356358};
359+
360+ #endif // MICROPY_HW_ENABLE_DAC
Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ STATIC mp_obj_t os_sync(void) {
253253}
254254STATIC MP_DEFINE_CONST_FUN_OBJ_0 (os_sync_obj , os_sync );
255255
256+ #if MICROPY_HW_ENABLE_RNG
256257STATIC mp_obj_t os_urandom (mp_obj_t num ) {
257258 mp_int_t n = mp_obj_get_int (num );
258259 byte * data ;
@@ -263,6 +264,7 @@ STATIC mp_obj_t os_urandom(mp_obj_t num) {
263264 return mp_obj_str_builder_end (o );
264265}
265266STATIC MP_DEFINE_CONST_FUN_OBJ_1 (os_urandom_obj , os_urandom );
267+ #endif
266268
267269STATIC const mp_map_elem_t os_module_globals_table [] = {
268270 { MP_OBJ_NEW_QSTR (MP_QSTR___name__ ), MP_OBJ_NEW_QSTR (MP_QSTR_os ) },
@@ -280,7 +282,9 @@ STATIC const mp_map_elem_t os_module_globals_table[] = {
280282
281283 { MP_OBJ_NEW_QSTR (MP_QSTR_sep ), MP_OBJ_NEW_QSTR (MP_QSTR__slash_ ) },
282284
285+ #if MICROPY_HW_ENABLE_RNG
283286 { MP_OBJ_NEW_QSTR (MP_QSTR_urandom ), (mp_obj_t )& os_urandom_obj },
287+ #endif
284288};
285289
286290STATIC const mp_obj_dict_t os_module_globals = {
You can’t perform that action at this time.
0 commit comments