stm32: Access dict map directly instead of using helper function.
This commit is contained in:
parent
fb8fc597cf
commit
3503f9626a
@ -452,7 +452,7 @@ STATIC mp_obj_t pin_names(mp_obj_t self_in) {
|
||||
mp_obj_t result = mp_obj_new_list(0, NULL);
|
||||
mp_obj_list_append(result, MP_OBJ_NEW_QSTR(self->name));
|
||||
|
||||
mp_map_t *map = mp_obj_dict_get_map((mp_obj_t)&pin_board_pins_locals_dict);
|
||||
const mp_map_t *map = &pin_board_pins_locals_dict.map;
|
||||
mp_map_elem_t *elem = map->table;
|
||||
|
||||
for (mp_uint_t i = 0; i < map->used; i++, elem++) {
|
||||
|
@ -44,8 +44,8 @@ const mp_obj_type_t pin_board_pins_obj_type = {
|
||||
};
|
||||
|
||||
const pin_obj_t *pin_find_named_pin(const mp_obj_dict_t *named_pins, mp_obj_t name) {
|
||||
mp_map_t *named_map = mp_obj_dict_get_map((mp_obj_t)named_pins);
|
||||
mp_map_elem_t *named_elem = mp_map_lookup(named_map, name, MP_MAP_LOOKUP);
|
||||
const mp_map_t *named_map = &named_pins->map;
|
||||
mp_map_elem_t *named_elem = mp_map_lookup((mp_map_t*)named_map, name, MP_MAP_LOOKUP);
|
||||
if (named_elem != NULL && named_elem->value != NULL) {
|
||||
return named_elem->value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user