fix kconfig, add _REG32

This commit is contained in:
Jacob Dahl 2026-02-10 19:29:00 -09:00
parent 85dfa8c8b6
commit a3bb0d5b0a
4 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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;

View File

@ -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