AP_HAL_ChibiOS: reset pwm peripheral on F1 when deallocating IC DMA

This commit is contained in:
Andy Piper
2024-06-02 10:54:14 +10:00
committed by Andrew Tridgell
parent c2a9bc93b5
commit ae8a2d9513
5 changed files with 28 additions and 12 deletions
@@ -230,6 +230,11 @@ void RCOutput::bdshot_ic_dma_deallocate(Shared_DMA *ctx)
chSysLock();
if (group.bdshot.ic_dma_handle[icuch] == ctx && group.bdshot.ic_dma[icuch] != nullptr) {
dmaStreamFreeI(group.bdshot.ic_dma[icuch]);
#if defined(STM32F1)
if (group.bdshot.ic_dma_handle[icuch]->is_shared()) {
bdshot_disable_pwm_f1(group);
}
#endif
group.bdshot.ic_dma[icuch] = nullptr;
}
chSysUnlock();