durandal-v1: enable dshot

This commit is contained in:
Beat Küng
2019-11-28 16:51:09 +01:00
parent d5b655bad6
commit 0f42ecc5c7
10 changed files with 37 additions and 11 deletions

View File

@@ -174,11 +174,11 @@ void up_dshot_trigger(void)
first_motor += motors_number;
stm32_dmasetup(dshot_handler[timer].dma_handle,
io_timers[timer].base + STM32_GTIM_DMAR_OFFSET,
(uint32_t)(dshot_burst_buffer[timer]),
dshot_handler[timer].dma_size,
DSHOT_DMA_SCR);
px4_stm32_dmasetup(dshot_handler[timer].dma_handle,
io_timers[timer].base + STM32_GTIM_DMAR_OFFSET,
(uint32_t)(dshot_burst_buffer[timer]),
dshot_handler[timer].dma_size,
DSHOT_DMA_SCR);
// Clean UDE flag before DMA is started
io_timer_update_dma_req(timer, false);

View File

@@ -32,6 +32,6 @@
****************************************************************************/
#pragma once
#define px4_stm32_dmasetup stm32_dmasetup
#include "../../../stm32_common/include/px4_arch/dshot.h"

View File

@@ -33,5 +33,6 @@
#pragma once
#define px4_stm32_dmasetup stm32_dmasetup
#include "../../../stm32_common/include/px4_arch/dshot.h"

View File

@@ -33,5 +33,6 @@
#pragma once
#define px4_stm32_dmasetup stm32_dmasetup
#include "../../../stm32_common/include/px4_arch/dshot.h"

View File

@@ -32,5 +32,18 @@
****************************************************************************/
#pragma once
#include <stm32_dma.h>
static inline void px4_stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
size_t ntransfers, uint32_t scr)
{
struct stm32_dma_config_s cfg;
cfg.paddr = paddr;
cfg.maddr = maddr;
cfg.cfg1 = scr;
cfg.cfg2 = 0;
cfg.ndata = ntransfers;
stm32_dmasetup(handle, &cfg);
}
#include "../../../stm32_common/include/px4_arch/dshot.h"