From 755eca31c21015cceb66185d22e806e4cc432fb1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 8 Jan 2018 15:35:08 +1100 Subject: [PATCH] HAL_Chibios: don't unregister shared DMA the shared DMA handle is a property of the bus, not the device, so should not be unregistered when the device is removed --- libraries/AP_HAL_ChibiOS/I2CDevice.cpp | 1 - libraries/AP_HAL_ChibiOS/SPIDevice.cpp | 1 - libraries/AP_HAL_ChibiOS/shared_dma.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/I2CDevice.cpp b/libraries/AP_HAL_ChibiOS/I2CDevice.cpp index 69e4dbe4d9..d29d59bb27 100644 --- a/libraries/AP_HAL_ChibiOS/I2CDevice.cpp +++ b/libraries/AP_HAL_ChibiOS/I2CDevice.cpp @@ -59,7 +59,6 @@ I2CDevice::I2CDevice(uint8_t bus, uint8_t address) : I2CDevice::~I2CDevice() { - businfo[_busnum].dma_handle->unregister(); printf("I2C device bus %u address 0x%02x closed\n", (unsigned)_busnum, (unsigned)_address); free(pname); diff --git a/libraries/AP_HAL_ChibiOS/SPIDevice.cpp b/libraries/AP_HAL_ChibiOS/SPIDevice.cpp index 0e46cfb4ca..02a5d95867 100644 --- a/libraries/AP_HAL_ChibiOS/SPIDevice.cpp +++ b/libraries/AP_HAL_ChibiOS/SPIDevice.cpp @@ -164,7 +164,6 @@ SPIDevice::~SPIDevice() { //printf("SPI device %s on %u:%u closed\n", device_desc.name, // (unsigned)bus.bus, (unsigned)device_desc.device); - bus.dma_handle->unregister(); free(pname); } diff --git a/libraries/AP_HAL_ChibiOS/shared_dma.cpp b/libraries/AP_HAL_ChibiOS/shared_dma.cpp index e7d405773d..670520dbb6 100644 --- a/libraries/AP_HAL_ChibiOS/shared_dma.cpp +++ b/libraries/AP_HAL_ChibiOS/shared_dma.cpp @@ -53,7 +53,6 @@ void Shared_DMA::unregister() locks[stream_id2].deallocate(); locks[stream_id2].obj = nullptr; } - } // lock the DMA channels