mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Fixed handling of SPI parameters for Unified Targets.
This commit is contained in:
parent
b137bbe80c
commit
6f92a1ce13
10 changed files with 63 additions and 52 deletions
|
@ -44,7 +44,7 @@ static SPI_InitTypeDef defaultInit = {
|
|||
.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8,
|
||||
};
|
||||
|
||||
void spiInitDevice(SPIDevice device)
|
||||
void spiInitDevice(SPIDevice device, bool leadingEdge)
|
||||
{
|
||||
spiDevice_t *spi = &(spiDevice[device]);
|
||||
|
||||
|
@ -53,16 +53,9 @@ void spiInitDevice(SPIDevice device)
|
|||
}
|
||||
|
||||
#ifndef USE_SPI_TRANSACTION
|
||||
#ifdef SDCARD_SPI_INSTANCE
|
||||
if (spi->dev == SDCARD_SPI_INSTANCE) {
|
||||
spi->leadingEdge = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef RX_SPI_INSTANCE
|
||||
if (spi->dev == RX_SPI_INSTANCE) {
|
||||
spi->leadingEdge = true;
|
||||
}
|
||||
#endif
|
||||
spi->leadingEdge = leadingEdge;
|
||||
#else
|
||||
UNUSED(leadingEdge);
|
||||
#endif
|
||||
|
||||
// Enable SPI clock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue