HAL_ChibiOS: allow double allocate call in RCOutput

This commit is contained in:
Andrew Tridgell 2019-02-10 18:31:19 +11:00
parent c02a271c8a
commit d96142a37e
1 changed files with 1 additions and 2 deletions

View File

@ -819,8 +819,7 @@ void RCOutput::dma_allocate(Shared_DMA *ctx)
{ {
for (uint8_t i = 0; i < NUM_GROUPS; i++ ) { for (uint8_t i = 0; i < NUM_GROUPS; i++ ) {
pwm_group &group = pwm_group_list[i]; pwm_group &group = pwm_group_list[i];
if (group.dma_handle == ctx) { if (group.dma_handle == ctx && group.dma == nullptr) {
osalDbgAssert(group.dma == nullptr, "double DMA allocation");
chSysLock(); chSysLock();
group.dma = dmaStreamAllocI(group.dma_up_stream_id, 10, dma_irq_callback, &group); group.dma = dmaStreamAllocI(group.dma_up_stream_id, 10, dma_irq_callback, &group);
chSysUnlock(); chSysUnlock();