diff --git a/stm/audio.c b/stm/audio.c index e9e872813a8aaa1e83051510de2bb3a1ecf8a722..36fa77c4289165a8b1f8c9c04ba294fd683e39eb 100644 --- a/stm/audio.c +++ b/stm/audio.c @@ -127,8 +127,8 @@ mp_obj_t pyb_audio_dma(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) { if (type->buffer_p.get_buffer == NULL) { nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "buffer argument must support buffer protocol")); } - buffer_info_t bufinfo; - type->buffer_p.get_buffer(args[1], &bufinfo, BUFFER_READ); + mp_buffer_info_t bufinfo; + type->buffer_p.get_buffer(args[1], &bufinfo, MP_BUFFER_READ); RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA1, ENABLE); diff --git a/stm/exti.c b/stm/exti.c index c6dfd9d1a825e65715bb6eb7809337cfd8f9d490..a5d9fc16a74141ce3bd3319fad4891c4918f9c39 100644 --- a/stm/exti.c +++ b/stm/exti.c @@ -283,7 +283,7 @@ static void exti_load_attr(mp_obj_t self_in, qstr attr_qstr, mp_obj_t *dest) { static mp_obj_t exti_call(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { // type_in == exti_obj_type - mp_check_nargs(n_args, 4, 4, n_kw, 0); + mp_arg_check_num(n_args, n_kw, 4, 4, 0); exti_obj_t *self = m_new_obj(exti_obj_t); self->base.type = type_in; diff --git a/stm/math.c b/stm/math.c index 8afdc82a64b11e84a58f558266d58ecd75666222..e75ec1d4b93c6803b51f7634933c0ff676bc281f 100644 --- a/stm/math.c +++ b/stm/math.c @@ -18,6 +18,10 @@ typedef union { }; } double_s_t; +double __attribute__((pcs("aapcs"))) __aeabi_i2d(int32_t x) { + return (float)x; +} + double __attribute__((pcs("aapcs"))) __aeabi_f2d(float x) { float_s_t fx={0}; double_s_t dx={0}; diff --git a/stm/pin_map.c b/stm/pin_map.c index c5754ca33daf3eb4ffa0d1ae9c0dc5557287c667..bb2c054e782a819bf7ae54e85192d58c66ed252e 100644 --- a/stm/pin_map.c +++ b/stm/pin_map.c @@ -68,7 +68,7 @@ static void pin_map_obj_print(void (*print)(void *env, const char *fmt, ...), vo static mp_obj_t pin_map_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_t *args) { pin_map_obj_t *self = self_in; - mp_check_nargs(n_args, 1, 2, n_kw, false); + mp_arg_check_num(n_args, n_kw, 1, 2, false); if (n_args > 1) { if (!self->map_dict) {