diff options
| author | Angus Gratton <gus@projectgus.com> | 2022-07-08 12:47:52 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-11-11 13:23:24 +1100 |
| commit | b3e38ac632e6e38555f539e73a24c43053ae71f6 (patch) | |
| tree | 459f2158006ece2901f664c9f8f834c3d3c2eefe | |
| parent | ea07ab04f80dbabd050aef972119e72c133aaa09 (diff) | |
stm32/spi: Downgrade SPIHandle definitions to static.
Seems unused outside of spi.c, spi_obj[] array is the expected way to
iterate these.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
| -rw-r--r-- | ports/stm32/spi.c | 12 | ||||
| -rw-r--r-- | ports/stm32/spi.h | 7 |
2 files changed, 6 insertions, 13 deletions
diff --git a/ports/stm32/spi.c b/ports/stm32/spi.c index e21ebcd02..946e83e43 100644 --- a/ports/stm32/spi.c +++ b/ports/stm32/spi.c @@ -47,22 +47,22 @@ // SPI6_RX: DMA2_Stream6.CHANNEL_1 #if defined(MICROPY_HW_SPI1_SCK) -SPI_HandleTypeDef SPIHandle1 = {.Instance = NULL}; +STATIC SPI_HandleTypeDef SPIHandle1 = {.Instance = NULL}; #endif #if defined(MICROPY_HW_SPI2_SCK) -SPI_HandleTypeDef SPIHandle2 = {.Instance = NULL}; +STATIC SPI_HandleTypeDef SPIHandle2 = {.Instance = NULL}; #endif #if defined(MICROPY_HW_SPI3_SCK) -SPI_HandleTypeDef SPIHandle3 = {.Instance = NULL}; +STATIC SPI_HandleTypeDef SPIHandle3 = {.Instance = NULL}; #endif #if defined(MICROPY_HW_SPI4_SCK) -SPI_HandleTypeDef SPIHandle4 = {.Instance = NULL}; +STATIC SPI_HandleTypeDef SPIHandle4 = {.Instance = NULL}; #endif #if defined(MICROPY_HW_SPI5_SCK) -SPI_HandleTypeDef SPIHandle5 = {.Instance = NULL}; +STATIC SPI_HandleTypeDef SPIHandle5 = {.Instance = NULL}; #endif #if defined(MICROPY_HW_SPI6_SCK) -SPI_HandleTypeDef SPIHandle6 = {.Instance = NULL}; +STATIC SPI_HandleTypeDef SPIHandle6 = {.Instance = NULL}; #endif const spi_t spi_obj[6] = { diff --git a/ports/stm32/spi.h b/ports/stm32/spi.h index ef3d718cd..b2aceafbf 100644 --- a/ports/stm32/spi.h +++ b/ports/stm32/spi.h @@ -54,13 +54,6 @@ typedef struct _machine_hard_spi_obj_t { const spi_t *spi; } machine_hard_spi_obj_t; -extern SPI_HandleTypeDef SPIHandle1; -extern SPI_HandleTypeDef SPIHandle2; -extern SPI_HandleTypeDef SPIHandle3; -extern SPI_HandleTypeDef SPIHandle4; -extern SPI_HandleTypeDef SPIHandle5; -extern SPI_HandleTypeDef SPIHandle6; - extern const spi_t spi_obj[6]; extern const mp_spi_proto_t spi_proto; |
