Skip to content

Commit 2ff81f0

Browse files
committed
ports/rp2: Clean up some unused vestigial code
1 parent 74683ed commit 2ff81f0

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

ports/rp2/rp2_dma.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,6 @@ STATIC uint32_t rp2_dma_register_value_from_obj(mp_obj_t o, int reg_type) {
101101
}
102102
}
103103

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-
116104
// DMAConfigs can cast as integers; we don't want them as counts or addresses
117105
if (reg_type != REG_TYPE_CONF && mp_obj_is_type(o, &rp2_dma_config_type)) {
118106
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) {
327315
rp2_dma_error_if_closed(self);
328316
uint32_t busy = dma_channel_is_busy(self->channel);
329317
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);
332318
} else if (attr_in == MP_QSTR_default_config) {
333319
// Get the default config for _this_ channel, i.e. with chaining disabled.
334320
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) {
358344
reg_view->items = dma_channel_hw_addr(self->channel);
359345
dest[0] = reg_view;
360346
} 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.
362348
// We do it manually here.
363349
mp_map_t *locals_map = (mp_map_t *)&rp2_dma_locals_dict.map;
364350
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
424410
{ MP_QSTR_read, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
425411
{ MP_QSTR_write, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
426412
{ 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} },
428414
{ MP_QSTR_trigger, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
429415
};
430416

0 commit comments

Comments
 (0)