diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-09-23 11:39:39 -0400 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-09-23 11:39:39 -0400 |
| commit | 00517b26009d6b721145995e40725625b5152afd (patch) | |
| tree | f52d498a4df75499ee3ad6f878363e467f2d199f /shared-bindings | |
| parent | 22d9a94f2b880c57b7939e3e08a6fecd1ef59720 (diff) | |
Move missing pin warning to shared-bindings
Diffstat (limited to 'shared-bindings')
| -rw-r--r-- | shared-bindings/busio/SPI.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index aefe4f5a7..e47564c8c 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -96,6 +96,10 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con const mcu_pin_obj_t* mosi = validate_obj_is_free_pin_or_none(args[ARG_MOSI].u_obj); const mcu_pin_obj_t* miso = validate_obj_is_free_pin_or_none(args[ARG_MISO].u_obj); + if (!miso && !mosi) { + mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); + } + common_hal_busio_spi_construct(self, clock, mosi, miso); return MP_OBJ_FROM_PTR(self); } |
