From 377893e173e3bac5b02d85d0c36b03fd89143d09 Mon Sep 17 00:00:00 2001 From: Michael Jakob Date: Thu, 2 Feb 2017 21:17:45 +0100 Subject: [PATCH] Register SDCard DMA in resource list --- src/main/drivers/resource.c | 3 ++- src/main/drivers/resource.h | 3 ++- src/main/drivers/sdcard.c | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/drivers/resource.c b/src/main/drivers/resource.c index 4a0e9b6a4..ffe33a3d2 100644 --- a/src/main/drivers/resource.c +++ b/src/main/drivers/resource.c @@ -41,7 +41,9 @@ const char * const ownerNames[OWNER_TOTAL_COUNT] = { "SPI_MOSI", "I2C_SCL", "I2C_SDA", + "SDCARD", "SDCARD_CS", + "SDCARD_DETECT", "FLASH_CS", "BARO_CS", "MPU_CS", @@ -54,7 +56,6 @@ const char * const ownerNames[OWNER_TOTAL_COUNT] = { "USB_DETECT", "BEEPER", "OSD", - "SDCARD_DETECT", "RX_BIND", "INVERTER", "LED_STRIP", diff --git a/src/main/drivers/resource.h b/src/main/drivers/resource.h index f5ba5f6a5..4b566efcf 100644 --- a/src/main/drivers/resource.h +++ b/src/main/drivers/resource.h @@ -41,7 +41,9 @@ typedef enum { OWNER_SPI_MOSI, OWNER_I2C_SCL, OWNER_I2C_SDA, + OWNER_SDCARD, OWNER_SDCARD_CS, + OWNER_SDCARD_DETECT, OWNER_FLASH_CS, OWNER_BARO_CS, OWNER_MPU_CS, @@ -54,7 +56,6 @@ typedef enum { OWNER_USB_DETECT, OWNER_BEEPER, OWNER_OSD, - OWNER_SDCARD_DETECT, OWNER_RX_BIND, OWNER_INVERTER, OWNER_LED_STRIP, diff --git a/src/main/drivers/sdcard.c b/src/main/drivers/sdcard.c index 66aafc25b..02441b2c6 100644 --- a/src/main/drivers/sdcard.c +++ b/src/main/drivers/sdcard.c @@ -24,6 +24,7 @@ #include "nvic.h" #include "io.h" +#include "dma.h" #include "bus_spi.h" #include "system.h" @@ -551,6 +552,9 @@ void sdcard_init(bool useDMA) { #ifdef SDCARD_DMA_CHANNEL_TX useDMAForTx = useDMA; + if (useDMAForTx) { + dmaInit(dmaGetIdentifier(SDCARD_DMA_CHANNEL_TX), OWNER_SDCARD, 0); + } #else // DMA is not available (void) useDMA;