mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
AT32 SD card support (#14070)
This commit is contained in:
parent
896c8ee29b
commit
b5ab83b3bc
5 changed files with 90 additions and 46 deletions
|
@ -208,6 +208,10 @@ void spiInternalStartDMA(const extDevice_t *dev)
|
|||
dmaChannelDescriptor_t *dmaTx = dev->bus->dmaTx;
|
||||
dmaChannelDescriptor_t *dmaRx = dev->bus->dmaRx;
|
||||
DMA_ARCH_TYPE *streamRegsTx = (DMA_ARCH_TYPE *)dmaTx->ref;
|
||||
|
||||
// Wait for any ongoing transmission to complete
|
||||
while (spi_i2s_flag_get(dev->bus->busType_u.spi.instance, SPI_I2S_BF_FLAG) == SET);
|
||||
|
||||
if (dmaRx) {
|
||||
DMA_ARCH_TYPE *streamRegsRx = (DMA_ARCH_TYPE *)dmaRx->ref;
|
||||
|
||||
|
@ -229,10 +233,10 @@ void spiInternalStartDMA(const extDevice_t *dev)
|
|||
xDMA_Init(streamRegsRx, dev->bus->initRx);
|
||||
|
||||
// Enable streams
|
||||
xDMA_Cmd(streamRegsTx, TRUE);
|
||||
xDMA_Cmd(streamRegsRx, TRUE);
|
||||
xDMA_Cmd(streamRegsTx, TRUE);
|
||||
|
||||
/* Enable the receiver before the transmitter to ensure that not bits are missed on reception. An interrupt between
|
||||
/* Enable the receiver before the transmitter to ensure that no bits are missed on reception. An interrupt between
|
||||
* the transmitter and receiver being enabled can otherwise cause a hang.
|
||||
*/
|
||||
spi_i2s_dma_receiver_enable(dev->bus->busType_u.spi.instance, TRUE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue