mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 10:13:33 +08:00
fix kconfig, add _REG32
This commit is contained in:
@@ -14,7 +14,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
|
|||||||
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
||||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||||
CONFIG_DRIVERS_DSHOT=y
|
CONFIG_DRIVERS_DSHOT=y
|
||||||
CONFIG_DRIVERS_DSHOT_BITBANG=y
|
CONFIG_DSHOT_BITBANG=y
|
||||||
CONFIG_DRIVERS_GPS=y
|
CONFIG_DRIVERS_GPS=y
|
||||||
CONFIG_DRIVERS_HEATER=y
|
CONFIG_DRIVERS_HEATER=y
|
||||||
CONFIG_DRIVERS_IMU_INVENSENSE_IIM42653=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)
|
set(DSHOT_SRC dshot_bitbang.c)
|
||||||
else()
|
else()
|
||||||
set(DSHOT_SRC dshot.c)
|
set(DSHOT_SRC dshot.c)
|
||||||
|
|||||||
@@ -87,6 +87,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer register macros (from io_timer.c, local to this file)
|
// 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 REG(_tmr, _reg) _REG32(io_timers[_tmr].base, _reg)
|
||||||
#define rCR1(_tmr) REG(_tmr, STM32_GTIM_CR1_OFFSET)
|
#define rCR1(_tmr) REG(_tmr, STM32_GTIM_CR1_OFFSET)
|
||||||
#define rCR2(_tmr) REG(_tmr, STM32_GTIM_CR2_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
|
// Auto-reload: one DMA transfer per timer update
|
||||||
rARR(timer_index) = SUBPERIODS_PER_BIT - 1;
|
rARR(timer_index) = SUBPERIODS_PER_BIT - 1;
|
||||||
|
|
||||||
test
|
|
||||||
|
|
||||||
// Generate update event to load prescaler
|
// Generate update event to load prescaler
|
||||||
rEGR(timer_index) = GTIM_EGR_UG;
|
rEGR(timer_index) = GTIM_EGR_UG;
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,10 @@ menuconfig DRIVERS_DSHOT
|
|||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable support for dshot
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user