Skip to content

Commit 1f38293

Browse files
committed
Fix ESP related issues
1 parent 9633c4e commit 1f38293

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

ports/espressif/bindings/espidf/__init__.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
131131
make_new, mp_obj_exception_make_new,
132132
attr, mp_obj_exception_attr,
133133
parent, &mp_type_MemoryError
134-
};
134+
);
135135

136136
//| def get_total_psram() -> int:
137137
//| """Returns the number of bytes of psram detected, or 0 if psram is not present or not configured"""
@@ -170,3 +170,5 @@ const mp_obj_module_t espidf_module = {
170170
.base = { &mp_type_module },
171171
.globals = (mp_obj_dict_t *)&espidf_module_globals,
172172
};
173+
174+
MP_REGISTER_MODULE(MP_QSTR_espidf, espidf_module);

ports/espressif/bindings/espnow/Peers.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,15 @@ STATIC MP_DEFINE_CONST_DICT(espnow_peers_locals_dict, espnow_peers_locals_dict_t
8383

8484
STATIC void espnow_peers_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
8585
espnow_peers_obj_t *self = MP_OBJ_TO_PTR(self_in);
86-
mp_obj_list_t *list = MP_OBJ_TO_PTR(self->list);
87-
return list->base.type->print(print, self->list, kind);
86+
return MP_OBJ_TYPE_GET_SLOT(mp_obj_get_type(self->list), print)(print, self->list, kind);
8887
}
8988

9089
/******************************************************************************/
9190
/* peers unary_op */
9291

9392
STATIC mp_obj_t espnow_peers_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
9493
espnow_peers_obj_t *self = MP_OBJ_TO_PTR(self_in);
95-
mp_obj_list_t *list = MP_OBJ_TO_PTR(self->list);
96-
return list->base.type->ext->unary_op(op, self->list);
94+
return MP_OBJ_TYPE_GET_SLOT(mp_obj_get_type(self->list), unary_op)(op, self->list);
9795
}
9896

9997
/******************************************************************************/
@@ -104,17 +102,15 @@ STATIC mp_obj_t espnow_peers_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t v
104102
return MP_OBJ_NULL; // op not supported
105103
}
106104
espnow_peers_obj_t *self = MP_OBJ_TO_PTR(self_in);
107-
mp_obj_list_t *list = MP_OBJ_TO_PTR(self->list);
108-
return list->base.type->ext->subscr(self->list, index, value);
105+
return MP_OBJ_TYPE_GET_SLOT(mp_obj_get_type(self->list), subscr)(self->list, index, value);
109106
}
110107

111108
/******************************************************************************/
112109
/* peers iterator */
113110

114111
STATIC mp_obj_t espnow_peers_getiter(mp_obj_t self_in, mp_obj_iter_buf_t *iter_buf) {
115112
espnow_peers_obj_t *self = MP_OBJ_TO_PTR(self_in);
116-
mp_obj_list_t *list = MP_OBJ_TO_PTR(self->list);
117-
return list->base.type->ext->getiter(self->list, iter_buf);
113+
return ((mp_getiter_fun_t)MP_OBJ_TYPE_GET_SLOT(mp_obj_get_type(self->list), iter))(self->list, iter_buf);
118114
}
119115

120116
espnow_peers_obj_t *espnow_peers_new(void) {

shared-bindings/socketpool/SocketPool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void common_hal_socketpool_socketpool_raise_gaierror_noname(void) {
220220

221221
mp_obj_t exc_args[] = {
222222
MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_EAI_NONAME),
223-
mp_obj_new_str_from_vstr(&mp_type_str, &vstr),
223+
mp_obj_new_str_from_vstr(&vstr),
224224
};
225225
nlr_raise(mp_obj_new_exception_args(&mp_type_gaierror, MP_ARRAY_SIZE(exc_args), exc_args));
226226
}

shared-bindings/wifi/Monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1/*
1+
/*
22
* This file is part of the MicroPython project, http://micropython.org/
33
*
44
* The MIT License (MIT)

0 commit comments

Comments
 (0)