HAL_ChibiOS: disable shared DMA on IOMCU

this saves about 600 bytes of ram
This commit is contained in:
Andrew Tridgell 2021-02-23 15:07:53 +11:00
parent bf999f701f
commit 243cf2199d
7 changed files with 14 additions and 2 deletions

View File

@ -192,7 +192,10 @@ static void main_loop()
ChibiOS::I2CBus::clear_all();
#endif
#ifndef HAL_NO_SHARED_DMA
ChibiOS::Shared_DMA::init();
#endif
peripheral_power_enable();
hal.serial(0)->begin(115200);

View File

@ -154,6 +154,7 @@ void RCOutput::rcout_thread()
}
}
#ifndef HAL_NO_SHARED_DMA
// release locks on the groups that are pending in reverse order
void RCOutput::dshot_collect_dma_locks(uint32_t last_run_us)
{
@ -192,6 +193,7 @@ void RCOutput::dshot_collect_dma_locks(uint32_t last_run_us)
}
}
}
#endif // HAL_NO_SHARED_DMA
/*
setup the output frequency for a group and start pwm output

View File

@ -375,7 +375,9 @@ void Util::thread_info(ExpandingString &str)
// request information on dma contention
void Util::dma_info(ExpandingString &str)
{
#ifndef HAL_NO_SHARED_DMA
ChibiOS::Shared_DMA::dma_info(str);
#endif
}
#endif

View File

@ -276,7 +276,6 @@ void set_rtc_backup(uint8_t idx, const uint32_t *v, uint8_t n)
// get RTC backup registers starting at given idx
void get_rtc_backup(uint8_t idx, uint32_t *v, uint8_t n)
{
return 0;
}
#endif // NO_FASTBOOT

View File

@ -120,6 +120,7 @@ define HAL_NO_TIMER_THREAD
define HAL_NO_RCIN_THREAD
define HAL_NO_MONITOR_THREAD
define HAL_NO_RCOUT_THREAD
define HAL_NO_SHARED_DMA
#defined to turn off undef warnings
define __FPU_PRESENT 0

View File

@ -20,7 +20,7 @@
code to handle sharing of DMA channels between peripherals
*/
#if CH_CFG_USE_MUTEXES == TRUE
#if CH_CFG_USE_MUTEXES == TRUE && !defined(HAL_NO_SHARED_DMA)
#include <AP_Common/ExpandingString.h>
@ -267,3 +267,4 @@ void Shared_DMA::dma_info(ExpandingString &str)
}
#endif // CH_CFG_USE_SEMAPHORES

View File

@ -23,6 +23,8 @@
// DMA stream ID for stream_id2 when only one is needed
#define SHARED_DMA_NONE 255
#ifndef HAL_NO_SHARED_DMA
class ChibiOS::Shared_DMA
{
public:
@ -108,3 +110,5 @@ private:
uint32_t transactions;
} *_contention_stats;
};
#endif // HAL_NO_SHARED_DMA