1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Add and handle USE_DMA

This commit is contained in:
jflyper 2018-10-09 00:35:58 +09:00
parent 45b7fa8095
commit 1c76469251
5 changed files with 14 additions and 2 deletions

View file

@ -24,6 +24,8 @@
#include "platform.h"
#ifdef USE_DMA
#include "drivers/nvic.h"
#include "dma.h"
@ -141,4 +143,5 @@ DMA_Channel_TypeDef* dmaGetRefByIdentifier(const dmaIdentifier_e identifier)
dmaChannelDescriptor_t* dmaGetDescriptorByIdentifier(const dmaIdentifier_e identifier)
{
return &dmaDescriptors[DMA_IDENTIFIER_TO_INDEX(identifier)];
}
}
#endif

View file

@ -24,6 +24,8 @@
#include "platform.h"
#ifdef USE_DMA
#include "drivers/nvic.h"
#include "dma.h"
#include "resource.h"
@ -156,4 +158,5 @@ dmaChannelDescriptor_t* dmaGetDescriptorByIdentifier(const dmaIdentifier_e ident
uint32_t dmaGetChannel(const uint8_t channel)
{
return ((uint32_t)channel*2)<<24;
}
}
#endif

View file

@ -24,6 +24,8 @@
#include "platform.h"
#ifdef USE_DMA
#include "drivers/nvic.h"
#include "drivers/dma.h"
#include "resource.h"
@ -139,3 +141,4 @@ uint32_t dmaGetChannel(const uint8_t channel)
{
return ((uint32_t)channel*2)<<24;
}
#endif

View file

@ -41,6 +41,7 @@ typedef enum {
typedef struct uartPort_s {
serialPort_t port;
#ifdef USE_DMA
#if defined(STM32F7)
DMA_HandleTypeDef rxDMAHandle;
DMA_HandleTypeDef txDMAHandle;
@ -61,6 +62,7 @@ typedef struct uartPort_s {
uint32_t txDMAPeripheralBaseAddr;
uint32_t rxDMAPeripheralBaseAddr;
#endif // USE_DMA
#ifdef USE_HAL_DRIVER
// All USARTs can also be used as UART, and we use them only as UART.

View file

@ -141,6 +141,7 @@
#define USE_BRUSHED_ESC_AUTODETECT // Detect if brushed motors are connected and set defaults appropriately to avoid motors spinning on boot
#define USE_PWM_OUTPUT
#define USE_DMA
#define USE_CLI
#define USE_SERIAL_PASSTHROUGH