Merge pull request #2662 from blckmn/f4_dma_fix
Fix for F4 broken DSHOT
This commit is contained in:
commit
1acf06c69c
|
@ -153,11 +153,7 @@ void ws2811LedStripHardwareInit(ioTag_t ioTag)
|
|||
|
||||
DMA_Init(dmaRef, &DMA_InitStructure);
|
||||
TIM_DMACmd(timer, timerDmaSource(timerHardware->channel), ENABLE);
|
||||
|
||||
DMA_ITConfig(dmaRef, DMA_IT_TC, ENABLE);
|
||||
#ifdef STM32F4
|
||||
DMA_ClearITPendingBit(dmaRef, dmaFlag_IT_TCIF(dmaRef));
|
||||
#endif
|
||||
ws2811Initialised = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -188,13 +188,16 @@ void pwmDigitalMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t
|
|||
dmaInit(timerHardware->dmaIrqHandler, OWNER_MOTOR, RESOURCE_INDEX(motorIndex));
|
||||
dmaSetHandler(timerHardware->dmaIrqHandler, motor_DMA_IRQHandler, NVIC_BUILD_PRIORITY(1, 2), motorIndex);
|
||||
|
||||
DMA_Cmd(dmaRef, DISABLE);
|
||||
DMA_DeInit(dmaRef);
|
||||
|
||||
DMA_StructInit(&DMA_InitStructure);
|
||||
#if defined(STM32F3)
|
||||
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)motor->dmaBuffer;
|
||||
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
|
||||
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
|
||||
#elif defined(STM32F4)
|
||||
DMA_InitStructure.DMA_Channel = timerHardware->channel;
|
||||
DMA_InitStructure.DMA_Channel = timerHardware->dmaChannel;
|
||||
DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)motor->dmaBuffer;
|
||||
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;
|
||||
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable;
|
||||
|
|
Loading…
Reference in New Issue