Skip to content

Commit

Permalink
FIX: SPI PIN defaults cleanup betaflight#2 (betaflight#12487)
Browse files Browse the repository at this point in the history
  • Loading branch information
blckmn authored and davidbitton committed Feb 5, 2024
1 parent 1c740d9 commit e4ce8e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 58 deletions.
36 changes: 0 additions & 36 deletions src/main/drivers/at32/platform_mcu.h
Expand Up @@ -93,39 +93,3 @@ typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
#define DMA_RAM_RW

#define USE_LATE_TASK_STATISTICS

#ifndef SPI1_SCK_PIN
#define SPI1_SCK_PIN PA5
#define SPI1_SDI_PIN PA6
#define SPI1_SDO_PIN PA7
#endif

#ifndef SPI2_SCK_PIN
#define SPI2_SCK_PIN PB13
#define SPI2_SDI_PIN PB14
#define SPI2_SDO_PIN PB15
#endif

#ifndef SPI3_SCK_PIN
#define SPI3_SCK_PIN PB3
#define SPI3_SDI_PIN PB4
#define SPI3_SDO_PIN PB5
#endif

#ifndef SPI4_SCK_PIN
#define SPI4_SCK_PIN NONE
#define SPI4_SDI_PIN NONE
#define SPI4_SDO_PIN NONE
#endif

#ifndef SPI5_SCK_PIN
#define SPI5_SCK_PIN NONE
#define SPI5_SDI_PIN NONE
#define SPI5_SDO_PIN NONE
#endif

#ifndef SPI6_SCK_PIN
#define SPI6_SCK_PIN NONE
#define SPI6_SDI_PIN NONE
#define SPI6_SDO_PIN NONE
#endif
23 changes: 1 addition & 22 deletions src/main/drivers/stm32/bus_spi_ll.c
Expand Up @@ -39,27 +39,6 @@
// Use DMA if possible if this many bytes are to be transferred
#define SPI_DMA_THRESHOLD 8

#ifndef SPI2_SCK_PIN
#define SPI2_NSS_PIN PB12
#define SPI2_SCK_PIN PB13
#define SPI2_SDI_PIN PB14
#define SPI2_SDO_PIN PB15
#endif

#ifndef SPI3_SCK_PIN
#define SPI3_NSS_PIN PA15
#define SPI3_SCK_PIN PB3
#define SPI3_SDI_PIN PB4
#define SPI3_SDO_PIN PB5
#endif

#ifndef SPI4_SCK_PIN
#define SPI4_NSS_PIN PA15
#define SPI4_SCK_PIN PB3
#define SPI4_SDI_PIN PB4
#define SPI4_SDO_PIN PB5
#endif

#ifndef SPI1_NSS_PIN
#define SPI1_NSS_PIN NONE
#endif
Expand Down Expand Up @@ -140,7 +119,7 @@ void spiInitDevice(SPIDevice device)
RCC_ClockCmd(spi->rcc, ENABLE);
RCC_ResetCmd(spi->rcc, ENABLE);

IOInit(IOGetByTag(spi->sck), OWNER_SPI_SCK, RESOURCE_INDEX(device));
IOInit(IOGetByTag(spi->sck), OWNER_SPI_SCK, RESOURCE_INDEX(device));
IOInit(IOGetByTag(spi->miso), OWNER_SPI_SDI, RESOURCE_INDEX(device));
IOInit(IOGetByTag(spi->mosi), OWNER_SPI_SDO, RESOURCE_INDEX(device));

Expand Down

0 comments on commit e4ce8e0

Please sign in to comment.