diff options
author | Damien George <damien.p.george@gmail.com> | 2018-02-02 17:44:05 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-02-02 17:44:05 +1100 |
commit | 762db9ad2f44dc87220b0ae1009251615d8e2e18 (patch) | |
tree | ba9d114c89208c5515122e8be7a34dd1ed4f3f07 | |
parent | 618aaa4a533c97b82761935c2939addf2f07ed45 (diff) |
stm32/spi: Add support for a board naming SPI peripherals 4, 5 and 6.
-rw-r--r-- | ports/stm32/spi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ports/stm32/spi.c b/ports/stm32/spi.c index 2b5bdb038..2b743bdfa 100644 --- a/ports/stm32/spi.c +++ b/ports/stm32/spi.c @@ -179,6 +179,18 @@ STATIC int spi_find(mp_obj_t id) { } else if (strcmp(port, MICROPY_HW_SPI3_NAME) == 0) { return 3; #endif + #ifdef MICROPY_HW_SPI4_NAME + } else if (strcmp(port, MICROPY_HW_SPI4_NAME) == 0) { + return 4; + #endif + #ifdef MICROPY_HW_SPI5_NAME + } else if (strcmp(port, MICROPY_HW_SPI5_NAME) == 0) { + return 5; + #endif + #ifdef MICROPY_HW_SPI6_NAME + } else if (strcmp(port, MICROPY_HW_SPI6_NAME) == 0) { + return 6; + #endif } nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "SPI(%s) doesn't exist", port)); |