From 95acc2bf345de8c59dba1155f694579407d9a430 Mon Sep 17 00:00:00 2001 From: bkleiner Date: Sun, 21 Jul 2024 14:14:13 +0200 Subject: [PATCH] elimnate spi_enable_rcc --- src/driver/at32/spi.c | 4 +--- src/driver/spi.c | 4 ---- src/driver/stm32/spi.c | 4 +--- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/driver/at32/spi.c b/src/driver/at32/spi.c index d9ee0392e..d3fd7d8d2 100644 --- a/src/driver/at32/spi.c +++ b/src/driver/at32/spi.c @@ -3,8 +3,6 @@ #include "core/failloop.h" #include "driver/interrupt.h" -extern void spi_enable_rcc(spi_ports_t port); - extern bool spi_txn_can_send(spi_bus_device_t *bus, bool dma); extern void spi_txn_finish(spi_ports_t port); @@ -239,9 +237,9 @@ static void spi_device_init(spi_ports_t port) { } spi_init_pins(port); - spi_enable_rcc(port); const spi_port_def_t *def = &spi_port_defs[port]; + rcc_enable(def->rcc); dma_enable_rcc(def->dma_rx); dma_enable_rcc(def->dma_tx); diff --git a/src/driver/spi.c b/src/driver/spi.c index 923f3f3c8..e650c5873 100644 --- a/src/driver/spi.c +++ b/src/driver/spi.c @@ -14,10 +14,6 @@ DMA_RAM uint8_t txn_buffers[SPI_TXN_MAX][DMA_ALIGN(512)]; extern void spi_reconfigure(spi_bus_device_t *bus); extern void spi_dma_transfer_begin(spi_ports_t port, uint8_t *buffer, uint32_t length); -void spi_enable_rcc(spi_ports_t port) { - rcc_enable(spi_port_defs[port].rcc); -} - static inline __attribute__((always_inline)) spi_txn_t *spi_txn_pop(spi_bus_device_t *bus) { ATOMIC_BLOCK_ALL { for (uint32_t i = 0; i < SPI_TXN_MAX; i++) { diff --git a/src/driver/stm32/spi.c b/src/driver/stm32/spi.c index 2cf2184e0..bef56a5ec 100644 --- a/src/driver/stm32/spi.c +++ b/src/driver/stm32/spi.c @@ -3,8 +3,6 @@ #include "core/failloop.h" #include "driver/interrupt.h" -extern void spi_enable_rcc(spi_ports_t port); - extern bool spi_txn_can_send(spi_bus_device_t *bus, bool dma); extern void spi_txn_finish(spi_ports_t port); @@ -252,9 +250,9 @@ static void spi_device_init(spi_ports_t port) { } spi_init_pins(port); - spi_enable_rcc(port); const spi_port_def_t *def = &spi_port_defs[port]; + rcc_enable(def->rcc); dma_enable_rcc(def->dma_rx); dma_enable_rcc(def->dma_tx);