Browse Source

AP_InertialSensor: use new API for DMA safe allocation

master
bugobliterator 7 years ago committed by Andrew Tridgell
parent
commit
1c6beaa7c4
  1. 4
      libraries/AP_InertialSensor/AP_InertialSensor_Invensense.cpp

4
libraries/AP_InertialSensor/AP_InertialSensor_Invensense.cpp

@ -284,7 +284,7 @@ AP_InertialSensor_Invensense::AP_InertialSensor_Invensense(AP_InertialSensor &im @@ -284,7 +284,7 @@ AP_InertialSensor_Invensense::AP_InertialSensor_Invensense(AP_InertialSensor &im
AP_InertialSensor_Invensense::~AP_InertialSensor_Invensense()
{
if (_fifo_buffer != nullptr) {
hal.util->dma_free(_fifo_buffer, MPU_FIFO_BUFFER_LEN * MPU_SAMPLE_SIZE);
hal.util->free_type(_fifo_buffer, MPU_FIFO_BUFFER_LEN * MPU_SAMPLE_SIZE, AP_HAL::Util::MEM_DMA_SAFE);
}
delete _auxiliary_bus;
}
@ -489,7 +489,7 @@ void AP_InertialSensor_Invensense::start() @@ -489,7 +489,7 @@ void AP_InertialSensor_Invensense::start()
set_accel_orientation(_accel_instance, _rotation);
// allocate fifo buffer
_fifo_buffer = (uint8_t *)hal.util->dma_allocate(MPU_FIFO_BUFFER_LEN * MPU_SAMPLE_SIZE);
_fifo_buffer = (uint8_t *)hal.util->malloc_type(MPU_FIFO_BUFFER_LEN * MPU_SAMPLE_SIZE, AP_HAL::Util::MEM_DMA_SAFE);
if (_fifo_buffer == nullptr) {
AP_HAL::panic("Invensense: Unable to allocate FIFO buffer");
}

Loading…
Cancel
Save