Metro M4 now compiles

This commit is contained in:
Dan Halbert 2023-10-03 15:03:59 -04:00
parent 1b9ecabf8b
commit 7e0e6fcdca
17 changed files with 41 additions and 35 deletions

View File

@ -171,7 +171,8 @@ STATIC mp_obj_t select_select(size_t n_args, const mp_obj_t *args) {
mp_map_deinit(&poll_map); mp_map_deinit(&poll_map);
return mp_obj_new_tuple(3, list_array); return mp_obj_new_tuple(3, list_array);
} }
MICROPY_EVENT_POLL_HOOK // CIRCUITPY
RUN_BACKGROUND_TASKS;
} }
} }
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_select_select_obj, 3, 4, select_select); MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_select_select_obj, 3, 4, select_select);
@ -250,7 +251,11 @@ STATIC mp_uint_t poll_poll_internal(uint n_args, const mp_obj_t *args) {
if (n_ready > 0 || (timeout != (mp_uint_t)-1 && mp_hal_ticks_ms() - start_tick >= timeout)) { if (n_ready > 0 || (timeout != (mp_uint_t)-1 && mp_hal_ticks_ms() - start_tick >= timeout)) {
break; break;
} }
MICROPY_EVENT_POLL_HOOK // CIRCUITPY
RUN_BACKGROUND_TASKS;
if (mp_hal_is_interrupted()) {
return 0;
}
} }
return n_ready; return n_ready;

View File

@ -23,8 +23,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#ifndef MICROPY_INCLUDED_SAMD_PENDSV_H
#define MICROPY_INCLUDED_SAMD_PENDSV_H
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_TARGET_H #ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_TARGET_H
#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_TARGET_H #define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_TARGET_H

View File

@ -898,6 +898,10 @@ extern const mp_obj_type_t mp_type_UnicodeError;
extern const mp_obj_type_t mp_type_ValueError; extern const mp_obj_type_t mp_type_ValueError;
extern const mp_obj_type_t mp_type_ViperTypeError; extern const mp_obj_type_t mp_type_ViperTypeError;
extern const mp_obj_type_t mp_type_ZeroDivisionError; extern const mp_obj_type_t mp_type_ZeroDivisionError;
#if CIRCUITPY_ALARM
extern const mp_obj_type_t mp_type_DeepSleepRequest;
#endif
// Constant objects, globally accessible: None, False, True // Constant objects, globally accessible: None, False, True
// These should always be accessed via the below macros. // These should always be accessed via the below macros.

View File

@ -228,6 +228,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
MP_TYPE_FLAG_ITER_IS_ITERNEXT, MP_TYPE_FLAG_ITER_IS_ITERNEXT,
make_new, bleio_characteristic_buffer_make_new, make_new, bleio_characteristic_buffer_make_new,
locals_dict, &bleio_characteristic_buffer_locals_dict, locals_dict, &bleio_characteristic_buffer_locals_dict,
iternext, mp_stream_unbuffered_iter, iter, mp_stream_unbuffered_iter,
protocol, &characteristic_buffer_stream_p protocol, &characteristic_buffer_stream_p
); );

View File

@ -63,6 +63,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
bleio_scanresults_type, bleio_scanresults_type,
MP_QSTR_ScanResults, MP_QSTR_ScanResults,
MP_TYPE_FLAG_ITER_IS_ITERNEXT, MP_TYPE_FLAG_ITER_IS_ITERNEXT,
getiter, mp_identity_getiter, iter, scanresults_iternext
iternext, scanresults_iternext
); );

View File

@ -288,5 +288,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
make_new, bleio_uuid_make_new, make_new, bleio_uuid_make_new,
locals_dict, &bleio_uuid_locals_dict, locals_dict, &bleio_uuid_locals_dict,
unary_op, bleio_uuid_unary_op, unary_op, bleio_uuid_unary_op,
binary_op, bleio_uuid_binary_op, binary_op, bleio_uuid_binary_op
); );

View File

@ -29,6 +29,7 @@
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO___INIT___H #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO___INIT___H
#define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO___INIT___H #define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO___INIT___H
#include "py/obj.h"
#include "py/objlist.h" #include "py/objlist.h"
#include "shared-bindings/_bleio/Adapter.h" #include "shared-bindings/_bleio/Adapter.h"
@ -41,14 +42,12 @@ extern bleio_adapter_obj_t common_hal_bleio_adapter_obj;
void bleio_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); void bleio_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind);
#define MP_DEFINE_BLEIO_EXCEPTION(exc_name, base_name) \ #define MP_DEFINE_BLEIO_EXCEPTION(exc_name, base_name) \
const mp_obj_type_t mp_type_bleio_##exc_name = { \ MP_DEFINE_CONST_OBJ_TYPE(mp_type_bleio_##exc_name, MP_QSTR_##exc_name, MP_TYPE_FLAG_NONE, \
{ &mp_type_type }, \ make_new, mp_obj_exception_make_new, \
.name = MP_QSTR_##exc_name, \ print, bleio_exception_print, \
.print = bleio_exception_print, \ attr, mp_obj_exception_attr, \
.make_new = mp_obj_exception_make_new, \ parent, &mp_type_##base_name \
.attr = mp_obj_exception_attr, \ );
.parent = &mp_type_##base_name, \
};
extern const mp_obj_type_t mp_type_bleio_BluetoothError; extern const mp_obj_type_t mp_type_bleio_BluetoothError;
extern const mp_obj_type_t mp_type_bleio_RoleError; extern const mp_obj_type_t mp_type_bleio_RoleError;

View File

@ -259,8 +259,8 @@ MP_DEFINE_CONST_OBJ_TYPE(
pixelmap_pixelmap_type, pixelmap_pixelmap_type,
MP_QSTR_PixelMap, MP_QSTR_PixelMap,
MP_TYPE_FLAG_NONE, MP_TYPE_FLAG_NONE,
.locals_dict, &pixelmap_pixelmap_locals_dict, locals_dict, &pixelmap_pixelmap_locals_dict,
.make_new, pixelmap_pixelmap_make_new, make_new, pixelmap_pixelmap_make_new,
.subscr, pixelmap_pixelmap_subscr, subscr, pixelmap_pixelmap_subscr,
.unary_op, pixelmap_pixelmap_unary_op unary_op, pixelmap_pixelmap_unary_op
); );

View File

@ -289,5 +289,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
MP_QSTR_I2CDevice, MP_QSTR_I2CDevice,
MP_TYPE_FLAG_NONE, MP_TYPE_FLAG_NONE,
make_new, adafruit_bus_device_i2cdevice_make_new, make_new, adafruit_bus_device_i2cdevice_make_new,
locals_dict = &adafruit_bus_device_i2cdevice_locals_dict locals_dict, &adafruit_bus_device_i2cdevice_locals_dict
); );

View File

@ -289,5 +289,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
MP_TYPE_FLAG_NONE, MP_TYPE_FLAG_NONE,
make_new, audiomp3_mp3file_make_new, make_new, audiomp3_mp3file_make_new,
locals_dict, &audiomp3_mp3file_locals_dict, locals_dict, &audiomp3_mp3file_locals_dict,
.protocol, &audiomp3_mp3file_proto protocol, &audiomp3_mp3file_proto
); );

View File

@ -214,12 +214,13 @@ STATIC const mp_rom_map_elem_t i2ctarget_i2c_target_locals_dict_table[] = {
STATIC MP_DEFINE_CONST_DICT(i2ctarget_i2c_target_locals_dict, i2ctarget_i2c_target_locals_dict_table); STATIC MP_DEFINE_CONST_DICT(i2ctarget_i2c_target_locals_dict, i2ctarget_i2c_target_locals_dict_table);
const mp_obj_type_t i2ctarget_i2c_target_type = { MP_DEFINE_CONST_OBJ_TYPE(
{ &mp_type_type }, i2ctarget_i2c_target_type,
.name = MP_QSTR_I2CTarget, MP_QSTR_I2CTarget,
.make_new = i2ctarget_i2c_target_make_new, MP_TYPE_FLAG_NONE,
.locals_dict = (mp_obj_dict_t *)&i2ctarget_i2c_target_locals_dict, make_new, i2ctarget_i2c_target_make_new,
}; locals_dict, &i2ctarget_i2c_target_locals_dict
);
//| class I2CTargetRequest: //| class I2CTargetRequest:
//| def __init__( //| def __init__(

View File

@ -167,7 +167,7 @@ STATIC const mp_stream_p_t eventqueue_p = {
MP_DEFINE_CONST_OBJ_TYPE( MP_DEFINE_CONST_OBJ_TYPE(
keypad_eventqueue_type, keypad_eventqueue_type,
P_QSTR_EventQueue, MP_QSTR_EventQueue,
MP_TYPE_FLAG_NONE, MP_TYPE_FLAG_NONE,
unary_op, keypad_eventqueue_unary_op, unary_op, keypad_eventqueue_unary_op,
#if MICROPY_PY_USELECT #if MICROPY_PY_USELECT

View File

@ -173,7 +173,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
keypad_keys_type, keypad_keys_type,
MP_QSTR_Keys, MP_QSTR_Keys,
MP_TYPE_FLAG_NONE, MP_TYPE_FLAG_NONE,
.make_new = keypad_keys_make_new make_new, keypad_keys_make_new
#if CIRCUITPY_KEYPAD_KEYS #if CIRCUITPY_KEYPAD_KEYS
, locals_dict, &keypad_keys_locals_dict , locals_dict, &keypad_keys_locals_dict
#endif #endif

View File

@ -428,5 +428,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &rgbmatrix_rgbmatrix_locals_dict, locals_dict, &rgbmatrix_rgbmatrix_locals_dict,
make_new, rgbmatrix_rgbmatrix_make_new, make_new, rgbmatrix_rgbmatrix_make_new,
buffer, rgbmatrix_rgbmatrix_get_buffer, buffer, rgbmatrix_rgbmatrix_get_buffer,
protocol = &rgbmatrix_rgbmatrix_proto protocol, &rgbmatrix_rgbmatrix_proto
); );

View File

@ -245,5 +245,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
vectorio_vector_shape_type, vectorio_vector_shape_type,
MP_QSTR_VectorShape, MP_QSTR_VectorShape,
MP_TYPE_FLAG_NONE, MP_TYPE_FLAG_NONE,
locals_dict = &vectorio_vector_shape_locals_dict locals_dict, &vectorio_vector_shape_locals_dict
); );

View File

@ -57,5 +57,5 @@ mp_obj_t shared_module_getpass_getpass(const char *prompt, mp_print_t *print) {
} }
} }
return mp_obj_new_str_from_vstr(&mp_type_str, &vstr); return mp_obj_new_str_from_vstr(&vstr);
} }

View File

@ -375,7 +375,7 @@ STATIC mp_obj_t unpack_bytes(msgpack_stream_t *s, size_t size) {
size -= n; size -= n;
p += n; p += n;
} }
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); return mp_obj_new_bytes_from_vstr(&vstr);
} }
STATIC mp_obj_t unpack_ext(msgpack_stream_t *s, size_t size, mp_obj_t ext_hook) { STATIC mp_obj_t unpack_ext(msgpack_stream_t *s, size_t size, mp_obj_t ext_hook) {
@ -474,7 +474,7 @@ STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) {
vstr_init_len(&vstr, size); vstr_init_len(&vstr, size);
byte *p = (byte *)vstr.buf; byte *p = (byte *)vstr.buf;
read(s, p, size); read(s, p, size);
return mp_obj_new_str_from_vstr(&mp_type_str, &vstr); return mp_obj_new_str_from_vstr(&vstr);
} }
case 0xde: case 0xde:
case 0xdf: { case 0xdf: {