From bf073e85f4fd64c37eff5604bf897fef780448bc Mon Sep 17 00:00:00 2001 From: EN Date: Fri, 12 Jul 2024 14:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6hcsr04.c=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E4=BD=9C=E7=94=A8=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Src/hcsr04.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Src/hcsr04.c b/Core/Src/hcsr04.c index aa57595..95a164e 100644 --- a/Core/Src/hcsr04.c +++ b/Core/Src/hcsr04.c @@ -2,9 +2,9 @@ #include "tim.h" // time 的单位是 μs -uint64_t time; // 声明变量,用来计时 -uint64_t time_end; // 声明变量,存储回波信号时间 -uint8_t state = 1; +static uint64_t time; // 声明变量,用来计时 +static uint64_t time_end; // 声明变量,存储回波信号时间 +static uint8_t state = 1; // HACK 临时的 delay 解决方法 void delay_us(uint16_t us);