diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-09-23 12:30:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-23 12:30:01 -0700 |
| commit | dd86cb00adb2ecb1e0cdf256d9a4e0f96a0c6de1 (patch) | |
| tree | 1659d90f50881cadf013ab4977146d9c2e6cf403 /shared-bindings | |
| parent | a8558a48ed91f5279a97d4d95669a40224dc6663 (diff) | |
| parent | 00517b26009d6b721145995e40725625b5152afd (diff) | |
Merge pull request #3448 from hierophect/esp32-sd-fix
ESP32S2 - Fix SPI's SD card issue, add pin protections
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); } |
