Skip to content

Commit

Permalink
Enable DMA on AT32F435 SPI (#12327)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans committed Feb 8, 2023
1 parent facf44b commit 0ac9962
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/fc/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ void init(void)
#endif

// On H7/G4 allocate SPI DMA streams after motor timers as SPI DMA allocate will always be possible
#if defined(STM32H7) || defined(STM32G4)
#if defined(STM32H7) || defined(STM32G4) || defined(AT32F435)
#ifdef USE_SPI
// Attempt to enable DMA on all SPI busses
spiInitBusDMA();
Expand Down
18 changes: 16 additions & 2 deletions src/main/target/AT32F435/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,23 @@
//#define I2C_FULL_RECONFIGURABILITY

#define USE_SPI
#define USE_SPI_DEVICE_1
#define USE_SPI_DEVICE_2
#define SPI_FULL_RECONFIGURABILITY

// AT-START-F435 J7 connector SPI 1
#define SPI2_SCK_PIN PD1
#define SPI2_MISO_PIN PC2
#define SPI2_MOSI_PIN PD4

#define J7_NSS PD0

#define GYRO_1_CS_PIN J7_NSS
#define GYRO_1_SPI_INSTANCE SPI2

#define USE_EXTI
#define USE_GYRO_EXTI
#define GYRO_1_EXTI_PIN PB11

#define USE_ACCGYRO_BMI160

//#define USE_USB_DETECT
#define USE_VCP
Expand Down

0 comments on commit 0ac9962

Please sign in to comment.