diff options
author | Damien George <damien@micropython.org> | 2020-09-25 14:47:34 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-10-01 12:57:10 +1000 |
commit | 71f3ade770fa7f2637d94f5ba5840b64a16a95db (patch) | |
tree | 4781c54bcfb9238d7e2fb5035ecc44ae9572a173 /ports/stm32/machine_spi.c | |
parent | 39d50d129ce428858332523548f0594503d0f45b (diff) | |
download | micropython-71f3ade770fa7f2637d94f5ba5840b64a16a95db.tar.gz micropython-71f3ade770fa7f2637d94f5ba5840b64a16a95db.zip |
ports: Support legacy soft I2C/SPI construction via id=-1 arg.
With a warning that this way of constructing software I2C/SPI is
deprecated. The check and warning will be removed in a future release.
This should help existing code to migrate to the new SoftI2C/SoftSPI types.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'ports/stm32/machine_spi.c')
-rw-r--r-- | ports/stm32/machine_spi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/stm32/machine_spi.c b/ports/stm32/machine_spi.c index edbd500b3c..37c026cefc 100644 --- a/ports/stm32/machine_spi.c +++ b/ports/stm32/machine_spi.c @@ -46,6 +46,8 @@ STATIC void machine_hard_spi_print(const mp_print_t *print, mp_obj_t self_in, mp } mp_obj_t machine_hard_spi_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + MP_MACHINE_SPI_CHECK_FOR_LEGACY_SOFTSPI_CONSTRUCTION(n_args, n_kw, all_args); + enum { ARG_id, ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits, ARG_firstbit, ARG_sck, ARG_mosi, ARG_miso }; static const mp_arg_t allowed_args[] = { { MP_QSTR_id, MP_ARG_REQUIRED | MP_ARG_OBJ }, |