mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 09:49:06 +08:00
fix kconfig, add _REG32
This commit is contained in:
parent
85dfa8c8b6
commit
a3bb0d5b0a
@ -14,7 +14,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
|
||||
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_DSHOT_BITBANG=y
|
||||
CONFIG_DSHOT_BITBANG=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_HEATER=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_IIM42653=y
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
if(CONFIG_DRIVERS_DSHOT_BITBANG)
|
||||
if(CONFIG_DSHOT_BITBANG)
|
||||
set(DSHOT_SRC dshot_bitbang.c)
|
||||
else()
|
||||
set(DSHOT_SRC dshot.c)
|
||||
|
||||
@ -87,6 +87,7 @@
|
||||
#endif
|
||||
|
||||
// Timer register macros (from io_timer.c, local to this file)
|
||||
#define _REG32(_base, _reg) (*(volatile uint32_t *)(_base + _reg))
|
||||
#define REG(_tmr, _reg) _REG32(io_timers[_tmr].base, _reg)
|
||||
#define rCR1(_tmr) REG(_tmr, STM32_GTIM_CR1_OFFSET)
|
||||
#define rCR2(_tmr) REG(_tmr, STM32_GTIM_CR2_OFFSET)
|
||||
@ -232,8 +233,6 @@ static void timer_configure_pacer(uint8_t timer_index)
|
||||
// Auto-reload: one DMA transfer per timer update
|
||||
rARR(timer_index) = SUBPERIODS_PER_BIT - 1;
|
||||
|
||||
test
|
||||
|
||||
// Generate update event to load prescaler
|
||||
rEGR(timer_index) = GTIM_EGR_UG;
|
||||
|
||||
|
||||
@ -3,3 +3,10 @@ menuconfig DRIVERS_DSHOT
|
||||
default n
|
||||
---help---
|
||||
Enable support for dshot
|
||||
|
||||
config DSHOT_BITBANG
|
||||
bool "Use bitbang DShot"
|
||||
default n
|
||||
depends on DRIVERS_DSHOT
|
||||
---help---
|
||||
Use bitbang GPIO DShot instead of DMA burst to timer registers
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user