@@ -101,18 +101,6 @@ STATIC uint32_t rp2_dma_register_value_from_obj(mp_obj_t o, int reg_type) {
101
101
}
102
102
}
103
103
104
- if (mp_obj_is_type (o , & rp2_state_machine_type )) {
105
- if (reg_type == REG_TYPE_ADDR_READ ) {
106
- // Return the address of the RX fifo
107
- return 0 ; // FIX ME
108
- } else if (reg_type == REG_TYPE_ADDR_WRITE ) {
109
- // Return the address of the TX fifo
110
- return 0 ; // FIX ME
111
- } else {
112
- mp_raise_ValueError (MP_ERROR_TEXT ("StateMachine only allowed for addresses" ));
113
- }
114
- }
115
-
116
104
// DMAConfigs can cast as integers; we don't want them as counts or addresses
117
105
if (reg_type != REG_TYPE_CONF && mp_obj_is_type (o , & rp2_dma_config_type )) {
118
106
mp_raise_ValueError (MP_ERROR_TEXT ("DMAConfig only allowed for config" ));
@@ -327,8 +315,6 @@ STATIC void rp2_dma_attr(mp_obj_t self_in, qstr attr_in, mp_obj_t *dest) {
327
315
rp2_dma_error_if_closed (self );
328
316
uint32_t busy = dma_channel_is_busy (self -> channel );
329
317
dest [0 ] = mp_obj_new_bool ((mp_int_t )busy );
330
- } else if (attr_in == MP_QSTR_reg_addr ) {
331
- dest [0 ] = mp_obj_new_int_from_uint ((mp_uint_t )reg_block );
332
318
} else if (attr_in == MP_QSTR_default_config ) {
333
319
// Get the default config for _this_ channel, i.e. with chaining disabled.
334
320
rp2_dma_config_obj_t * conf = m_new_obj (rp2_dma_config_obj_t );
@@ -358,7 +344,7 @@ STATIC void rp2_dma_attr(mp_obj_t self_in, qstr attr_in, mp_obj_t *dest) {
358
344
reg_view -> items = dma_channel_hw_addr (self -> channel );
359
345
dest [0 ] = reg_view ;
360
346
} else {
361
- // If Micropython classes support attributes then the locals dict is not searched.
347
+ // If a Micropython class supports attributes then the locals dict is not searched.
362
348
// We do it manually here.
363
349
mp_map_t * locals_map = (mp_map_t * )& rp2_dma_locals_dict .map ;
364
350
mp_map_elem_t * elem = mp_map_lookup (locals_map , MP_OBJ_NEW_QSTR (attr_in ), MP_MAP_LOOKUP );
@@ -424,7 +410,7 @@ STATIC mp_obj_t rp2_dma_setup(size_t n_args, const mp_obj_t *pos_args, mp_map_t
424
410
{ MP_QSTR_read , MP_ARG_KW_ONLY | MP_ARG_OBJ , {.u_obj = MP_OBJ_NULL } },
425
411
{ MP_QSTR_write , MP_ARG_KW_ONLY | MP_ARG_OBJ , {.u_obj = MP_OBJ_NULL } },
426
412
{ MP_QSTR_count , MP_ARG_KW_ONLY | MP_ARG_OBJ , {.u_obj = MP_OBJ_NULL } },
427
- { MP_QSTR_config , MP_ARG_KW_ONLY | MP_ARG_OBJ , {.u_obj = MP_OBJ_NULL } },
413
+ { MP_QSTR_config , MP_ARG_KW_ONLY | MP_ARG_OBJ , {.u_obj = MP_OBJ_NULL } },
428
414
{ MP_QSTR_trigger , MP_ARG_KW_ONLY | MP_ARG_BOOL , {.u_bool = false} },
429
415
};
430
416
0 commit comments