Browse Source

HAL_ChibiOS: allow double allocate call in RCOutput

mission-4.1.18
Andrew Tridgell 6 years ago
parent
commit
d96142a37e
  1. 3
      libraries/AP_HAL_ChibiOS/RCOutput.cpp

3
libraries/AP_HAL_ChibiOS/RCOutput.cpp

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

Loading…
Cancel
Save