AP_HAL_ChibiOS: move from HAL_NO_SHARED_DMA to AP_HAL_SHARED_DMA_ENABLED

This allows hwdef files to manipulate this value
This commit is contained in:
Peter Barker 2022-07-14 17:47:42 +10:00 committed by Peter Barker
parent 51466e04b0
commit 13b03f79db
8 changed files with 12 additions and 10 deletions

View File

@ -213,7 +213,7 @@ static void main_loop()
ChibiOS::I2CBus::clear_all();
#endif
#ifndef HAL_NO_SHARED_DMA
#if AP_HAL_SHARED_DMA_ENABLED
ChibiOS::Shared_DMA::init();
#endif

View File

@ -224,7 +224,7 @@ __RAMFUNC__ void RCOutput::dshot_update_tick(void* p)
chSysUnlockFromISR();
}
#ifndef HAL_NO_SHARED_DMA
#if AP_HAL_SHARED_DMA_ENABLED
// release locks on the groups that are pending in reverse order
void RCOutput::dshot_collect_dma_locks(uint32_t time_out_us)
{
@ -279,7 +279,7 @@ void RCOutput::dshot_collect_dma_locks(uint32_t time_out_us)
}
}
}
#endif // HAL_NO_SHARED_DMA
#endif // AP_HAL_SHARED_DMA_ENABLED
/*
setup the output frequency for a group and start pwm output

View File

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

View File

@ -119,7 +119,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
define AP_HAL_SHARED_DMA_ENABLED 0
#defined to turn off undef warnings
define __FPU_PRESENT 0

View File

@ -119,7 +119,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
define AP_HAL_SHARED_DMA_ENABLED 0
#defined to turn off undef warnings
define __FPU_PRESENT 0

View File

@ -1109,7 +1109,9 @@ def write_mcu_config(f):
#define HAL_NO_TIMER_THREAD
#define HAL_NO_RCOUT_THREAD
#define HAL_NO_RCIN_THREAD
#define HAL_NO_SHARED_DMA FALSE
#ifndef AP_HAL_SHARED_DMA_ENABLED
#define AP_HAL_SHARED_DMA_ENABLED 0
#endif
#define HAL_NO_ROMFS_SUPPORT TRUE
#define CH_CFG_USE_TM FALSE
#define CH_CFG_USE_REGISTRY FALSE

View File

@ -22,7 +22,7 @@
code to handle sharing of DMA channels between peripherals
*/
#if CH_CFG_USE_MUTEXES == TRUE && !defined(HAL_NO_SHARED_DMA)
#if CH_CFG_USE_MUTEXES == TRUE && AP_HAL_SHARED_DMA_ENABLED
#include <AP_Common/ExpandingString.h>

View File

@ -23,7 +23,7 @@
// DMA stream ID for stream_id2 when only one is needed
#define SHARED_DMA_NONE 255
#ifndef HAL_NO_SHARED_DMA
#if AP_HAL_SHARED_DMA_ENABLED
class ChibiOS::Shared_DMA
{
@ -114,4 +114,4 @@ private:
} *_contention_stats;
};
#endif // HAL_NO_SHARED_DMA
#endif // AP_HAL_SHARED_DMA_ENABLED