diff options
| author | Damien George | 2020-09-16 14:07:39 +1000 |
|---|---|---|
| committer | Damien George | 2020-10-01 12:57:10 +1000 |
| commit | 9e0533b9e158a455be9284b70011d0515096a5f6 (patch) | |
| tree | 1bb4763659e7c4ad43e5977c4274e5f55786b470 /ports/stm32/machine_spi.c | |
| parent | aaed33896b0fec67a0e2ec7daf3fe908253d8cf7 (diff) | |
extmod/machine_spi: Remove "id" arg in SoftSPI constructor.
The SoftSPI constructor is now used soley to create SoftSPI instances, it
can no longer delegate to create a hardware-based SPI instance.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'ports/stm32/machine_spi.c')
| -rw-r--r-- | ports/stm32/machine_spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/stm32/machine_spi.c b/ports/stm32/machine_spi.c index cf6e96ab6..edbd500b3 100644 --- a/ports/stm32/machine_spi.c +++ b/ports/stm32/machine_spi.c @@ -48,7 +48,7 @@ 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) { 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_OBJ, {.u_obj = MP_OBJ_NEW_SMALL_INT(-1)} }, + { MP_QSTR_id, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 500000} }, { MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_phase, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, @@ -137,7 +137,7 @@ const mp_obj_type_t machine_hard_spi_type = { { &mp_type_type }, .name = MP_QSTR_SPI, .print = machine_hard_spi_print, - .make_new = mp_machine_spi_make_new, // delegate to master constructor + .make_new = machine_hard_spi_make_new, .protocol = &machine_hard_spi_p, .locals_dict = (mp_obj_dict_t *)&mp_machine_spi_locals_dict, }; |
