Rewrite the M1 command to send the drive signal after receiving the M1 command, and turn on TIMER16 at the same time. Set the measurement completion flag after 240us, and turn off TIMER16 after the maximum TOF timing.

This commit is contained in:
2025-08-20 00:25:03 +08:00
parent 70a6311425
commit 16c5a31a63
4 changed files with 59 additions and 83 deletions

View File

@@ -58,11 +58,6 @@
/******************************************************************************/
#define US_TX_DELAY_RCU RCU_TIMER15
#define US_TX_DELAY_TIMER TIMER15
/******************************************************************************/
#define US_RX_GPIO_RCU RCU_GPIOB
#define US_RX_EXTI_RCU RCU_CFGCMP
#define US_RX_GPIO_PORT GPIOA
@@ -76,6 +71,7 @@
#define US_ECHO_RCU RCU_TIMER16
#define US_ECHO_TIMER TIMER16
#define US_ECHO_CH TIMER_CH_0
#define US_ECHO_TIMER_IRQ TIMER16_IRQn
/******************************************************************************/