diff options
| author | Damien George | 2018-07-08 23:25:11 +1000 |
|---|---|---|
| committer | Damien George | 2018-07-08 23:25:11 +1000 |
| commit | e1ae9939aca230758951f5b5b45084374e497254 (patch) | |
| tree | 9b5e424e366e94395cd4976dd9acc6eb906e87ae /ports/stm32/accel.c | |
| parent | aa735dc6a478f1f99f6e433b89ca047cbf536f33 (diff) | |
stm32: Support compiling with object representation D.
With this and previous patches the stm32 port can now be compiled using
object representation D (nan boxing). Note that native code and frozen mpy
files with float constants are currently not supported with this object
representation.
Diffstat (limited to 'ports/stm32/accel.c')
| -rw-r--r-- | ports/stm32/accel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/stm32/accel.c b/ports/stm32/accel.c index 49674eb2d..0d7708c09 100644 --- a/ports/stm32/accel.c +++ b/ports/stm32/accel.c @@ -122,7 +122,7 @@ STATIC mp_obj_t pyb_accel_make_new(const mp_obj_type_t *type, size_t n_args, siz pyb_accel_obj.base.type = &pyb_accel_type; accel_start(); - return &pyb_accel_obj; + return MP_OBJ_FROM_PTR(&pyb_accel_obj); } STATIC mp_obj_t read_axis(int axis) { @@ -166,7 +166,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_accel_tilt_obj, pyb_accel_tilt); /// \method filtered_xyz() /// Get a 3-tuple of filtered x, y and z values. STATIC mp_obj_t pyb_accel_filtered_xyz(mp_obj_t self_in) { - pyb_accel_obj_t *self = self_in; + pyb_accel_obj_t *self = MP_OBJ_TO_PTR(self_in); memmove(self->buf, self->buf + NUM_AXIS, NUM_AXIS * (FILT_DEPTH - 1) * sizeof(int16_t)); |
