mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
durandal-v1: enable dshot
This commit is contained in:
Submodule platforms/nuttx/NuttX/nuttx updated: 66401c8960...2d7920055f
@@ -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);
|
||||
|
||||
@@ -32,6 +32,6 @@
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
|
||||
|
||||
#define px4_stm32_dmasetup stm32_dmasetup
|
||||
#include "../../../stm32_common/include/px4_arch/dshot.h"
|
||||
|
||||
|
||||
@@ -33,5 +33,6 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#define px4_stm32_dmasetup stm32_dmasetup
|
||||
#include "../../../stm32_common/include/px4_arch/dshot.h"
|
||||
|
||||
|
||||
@@ -33,5 +33,6 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#define px4_stm32_dmasetup stm32_dmasetup
|
||||
#include "../../../stm32_common/include/px4_arch/dshot.h"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user