HAL_PX4: implement DMA allocation routines

This commit is contained in:
Andrew Tridgell 2016-11-23 20:30:48 +11:00
parent e42bb20052
commit 3fad5ca065
2 changed files with 23 additions and 0 deletions

View File

@ -224,4 +224,23 @@ void PX4Util::set_imu_target_temp(int8_t *target)
_heater.target = target;
}
extern "C" {
extern void *fat_dma_alloc(size_t);
extern void fat_dma_free(void *, size_t);
}
/*
allocate DMA-capable memory if possible. Otherwise return normal
memory.
*/
void *PX4Util::dma_allocate(size_t size)
{
return fat_dma_alloc(size);
}
void PX4Util::dma_free(void *ptr, size_t size)
{
fat_dma_free(ptr, size);
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_PX4

View File

@ -60,6 +60,10 @@ public:
void set_imu_temp(float current) override;
void set_imu_target_temp(int8_t *target) override;
// allocate and free DMA-capable memory if possible. Otherwise return normal memory
void *dma_allocate(size_t size) override;
void dma_free(void *ptr, size_t size) override;
private:
int _safety_handle;