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:
parent
45b7fa8095
commit
1c76469251
5 changed files with 14 additions and 2 deletions
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
#ifdef USE_DMA
|
||||||
|
|
||||||
#include "drivers/nvic.h"
|
#include "drivers/nvic.h"
|
||||||
#include "dma.h"
|
#include "dma.h"
|
||||||
|
|
||||||
|
@ -141,4 +143,5 @@ DMA_Channel_TypeDef* dmaGetRefByIdentifier(const dmaIdentifier_e identifier)
|
||||||
dmaChannelDescriptor_t* dmaGetDescriptorByIdentifier(const dmaIdentifier_e identifier)
|
dmaChannelDescriptor_t* dmaGetDescriptorByIdentifier(const dmaIdentifier_e identifier)
|
||||||
{
|
{
|
||||||
return &dmaDescriptors[DMA_IDENTIFIER_TO_INDEX(identifier)];
|
return &dmaDescriptors[DMA_IDENTIFIER_TO_INDEX(identifier)];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
#ifdef USE_DMA
|
||||||
|
|
||||||
#include "drivers/nvic.h"
|
#include "drivers/nvic.h"
|
||||||
#include "dma.h"
|
#include "dma.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
@ -156,4 +158,5 @@ dmaChannelDescriptor_t* dmaGetDescriptorByIdentifier(const dmaIdentifier_e ident
|
||||||
uint32_t dmaGetChannel(const uint8_t channel)
|
uint32_t dmaGetChannel(const uint8_t channel)
|
||||||
{
|
{
|
||||||
return ((uint32_t)channel*2)<<24;
|
return ((uint32_t)channel*2)<<24;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
#ifdef USE_DMA
|
||||||
|
|
||||||
#include "drivers/nvic.h"
|
#include "drivers/nvic.h"
|
||||||
#include "drivers/dma.h"
|
#include "drivers/dma.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
@ -139,3 +141,4 @@ uint32_t dmaGetChannel(const uint8_t channel)
|
||||||
{
|
{
|
||||||
return ((uint32_t)channel*2)<<24;
|
return ((uint32_t)channel*2)<<24;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -41,6 +41,7 @@ typedef enum {
|
||||||
typedef struct uartPort_s {
|
typedef struct uartPort_s {
|
||||||
serialPort_t port;
|
serialPort_t port;
|
||||||
|
|
||||||
|
#ifdef USE_DMA
|
||||||
#if defined(STM32F7)
|
#if defined(STM32F7)
|
||||||
DMA_HandleTypeDef rxDMAHandle;
|
DMA_HandleTypeDef rxDMAHandle;
|
||||||
DMA_HandleTypeDef txDMAHandle;
|
DMA_HandleTypeDef txDMAHandle;
|
||||||
|
@ -61,6 +62,7 @@ typedef struct uartPort_s {
|
||||||
|
|
||||||
uint32_t txDMAPeripheralBaseAddr;
|
uint32_t txDMAPeripheralBaseAddr;
|
||||||
uint32_t rxDMAPeripheralBaseAddr;
|
uint32_t rxDMAPeripheralBaseAddr;
|
||||||
|
#endif // USE_DMA
|
||||||
|
|
||||||
#ifdef USE_HAL_DRIVER
|
#ifdef USE_HAL_DRIVER
|
||||||
// All USARTs can also be used as UART, and we use them only as UART.
|
// All USARTs can also be used as UART, and we use them only as UART.
|
||||||
|
|
|
@ -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_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_PWM_OUTPUT
|
||||||
|
#define USE_DMA
|
||||||
|
|
||||||
#define USE_CLI
|
#define USE_CLI
|
||||||
#define USE_SERIAL_PASSTHROUGH
|
#define USE_SERIAL_PASSTHROUGH
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue