Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extmod/modselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static struct pollfd *poll_set_add_fd(poll_set_t *poll_set, int fd) {
}

static inline bool poll_set_all_are_fds(poll_set_t *poll_set) {
return poll_set->map.used == poll_set->used;
return mp_map_len(&poll_set->map) == poll_set->used;
}

#else
Expand Down
6 changes: 3 additions & 3 deletions ports/cc3200/mods/pybpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void pin_init0(void) {
// assign all pins to the GPIO module so that peripherals can be connected to any
// pins without conflicts after a soft reset
const mp_map_t *named_map = &pin_board_pins_locals_dict.map;
for (uint i = 0; i < named_map->used - 1; i++) {
for (uint i = 0; i < mp_map_len(named_map) - 1; i++) {
pin_obj_t * pin = (pin_obj_t *)named_map->table[i].value;
pin_deassign (pin);
}
Expand Down Expand Up @@ -216,7 +216,7 @@ static pin_obj_t *pin_find_named_pin(const mp_obj_dict_t *named_pins, mp_obj_t n

static pin_obj_t *pin_find_pin_by_port_bit (const mp_obj_dict_t *named_pins, uint port, uint bit) {
const mp_map_t *named_map = &named_pins->map;
for (uint i = 0; i < named_map->used; i++) {
for (uint i = 0; i < mp_map_len(named_map); i++) {
if ((((pin_obj_t *)named_map->table[i].value)->port == port) &&
(((pin_obj_t *)named_map->table[i].value)->bit == bit)) {
return named_map->table[i].value;
Expand All @@ -236,7 +236,7 @@ static int8_t pin_obj_find_af (const pin_obj_t* pin, uint8_t fn, uint8_t unit, u

static void pin_free_af_from_pins (uint8_t fn, uint8_t unit, uint8_t type) {
const mp_map_t *named_map = &pin_board_pins_locals_dict.map;
for (uint i = 0; i < named_map->used - 1; i++) {
for (uint i = 0; i < mp_map_len(named_map) - 1; i++) {
pin_obj_t * pin = (pin_obj_t *)named_map->table[i].value;
// af is different than GPIO
if (pin->af > PIN_MODE_0) {
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/mods/pybsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static void pyb_sleep_obj_wakeup (void) {

static void pyb_sleep_iopark (bool hibernate) {
const mp_map_t *named_map = &pin_board_pins_locals_dict.map;
for (uint i = 0; i < named_map->used; i++) {
for (uint i = 0; i < mp_map_len(named_map); i++) {
pin_obj_t * pin = (pin_obj_t *)named_map->table[i].value;
switch (pin->pin_num) {
#ifdef DEBUG
Expand Down
2 changes: 1 addition & 1 deletion ports/nrf/modules/machine/pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static mp_obj_t pin_names(mp_obj_t self_in) {
mp_map_t *map = mp_obj_dict_get_map((mp_obj_t)&pin_board_pins_locals_dict);
mp_map_elem_t *elem = map->table;

for (mp_uint_t i = 0; i < map->used; i++, elem++) {
for (mp_uint_t i = 0; i < mp_map_len(map); i++, elem++) {
if (elem->value == self) {
mp_obj_list_append(result, elem->key);
}
Expand Down
2 changes: 1 addition & 1 deletion ports/nrf/modules/ubluepy/ubluepy_scan_entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static mp_obj_t scan_entry_get_scan_data(mp_obj_t self_in) {
mp_map_t *constant_map = mp_obj_dict_get_map(MP_OBJ_TYPE_GET_SLOT(&ubluepy_constants_ad_types_type, locals_dict));
mp_map_elem_t *ad_types_table = MP_OBJ_TO_PTR(constant_map->table);

uint16_t num_of_elements = constant_map->used;
uint16_t num_of_elements = mp_map_len(constant_map);

for (uint16_t i = 0; i < num_of_elements; i++) {
mp_map_elem_t element = (mp_map_elem_t)*ad_types_table;
Expand Down
2 changes: 1 addition & 1 deletion ports/stm32/pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static mp_obj_t pin_names(mp_obj_t self_in) {
const mp_map_t *map = &machine_pin_board_pins_locals_dict.map;
mp_map_elem_t *elem = map->table;

for (mp_uint_t i = 0; i < map->used; i++, elem++) {
for (mp_uint_t i = 0; i < mp_map_len(map); i++, elem++) {
if (elem->value == self_in) {
mp_obj_list_append(result, elem->key);
}
Expand Down
1 change: 1 addition & 0 deletions ports/unix/variants/coverage/mpconfigvariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#define MICROPY_VFS_ROM_IOCTL (1)
#define MICROPY_PY_CRYPTOLIB_CTR (1)
#define MICROPY_SCHEDULER_STATIC_NODES (1)
#define MICROPY_PY_MAP_LARGE (1)

// Enable os.uname for attrtuple coverage test
#define MICROPY_PY_OS_UNAME (1)
Expand Down
Loading
Loading