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/modpyb.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/modpyb.c')
| -rw-r--r-- | ports/stm32/modpyb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/stm32/modpyb.c b/ports/stm32/modpyb.c index 5afbbc484..0e8313d10 100644 --- a/ports/stm32/modpyb.c +++ b/ports/stm32/modpyb.c @@ -93,7 +93,7 @@ STATIC mp_obj_t pyb_repl_uart(size_t n_args, const mp_obj_t *args) { if (MP_STATE_PORT(pyb_stdio_uart) == NULL) { return mp_const_none; } else { - return MP_STATE_PORT(pyb_stdio_uart); + return MP_OBJ_FROM_PTR(MP_STATE_PORT(pyb_stdio_uart)); } } else { if (args[0] == mp_const_none) { @@ -102,7 +102,7 @@ STATIC mp_obj_t pyb_repl_uart(size_t n_args, const mp_obj_t *args) { MP_STATE_PORT(pyb_stdio_uart) = NULL; } } else if (mp_obj_get_type(args[0]) == &pyb_uart_type) { - MP_STATE_PORT(pyb_stdio_uart) = args[0]; + MP_STATE_PORT(pyb_stdio_uart) = MP_OBJ_TO_PTR(args[0]); uart_attach_to_repl(MP_STATE_PORT(pyb_stdio_uart), true); } else { mp_raise_ValueError("need a UART object"); |
