From a3a5dc2af940d5dad48ff3b627dcf6e6a05a6242 Mon Sep 17 00:00:00 2001 From: yelvlab Date: Mon, 23 Sep 2024 21:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=BF=9B=E8=A1=8C=E4=B8=AD?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=BE=93=E5=85=A5=E6=8D=95=E8=8E=B7?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在ultrasonic_driver项目中,此次提交标志着向主目录添加新的源文件和头文件,旨在支持输入捕获实验。修改了CMakeLists.txt以包含新的input_capture_exp.c文件,同时在src和inc目录下分别创建了相应的源码和头文件。此外,此次提交还引入了输入捕获相关的硬件配置和初始化例程,为后续的功能开发和测试奠定了基础。 --- CMakeLists.txt | 1 + inc/input_capture_exp.h | 8 ++++++++ src/input_capture_exp.c | 7 +++++++ src/main.c | 8 +++----- 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 inc/input_capture_exp.h create mode 100644 src/input_capture_exp.c diff --git a/CMakeLists.txt b/CMakeLists.txt index c913a6c..76d4696 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ set(TARGET_C_SRC ${CMAKE_SOURCE_DIR}/src/gd32e23x_it.c ${CMAKE_SOURCE_DIR}/src/systick.c ${CMAKE_SOURCE_DIR}/src/ultrasonic_driver.c + ${CMAKE_SOURCE_DIR}/src/input_capture_exp.c ) add_executable(xlsw_3dp_ultrasonic_300K ${TARGET_C_SRC}) diff --git a/inc/input_capture_exp.h b/inc/input_capture_exp.h new file mode 100644 index 0000000..987ba28 --- /dev/null +++ b/inc/input_capture_exp.h @@ -0,0 +1,8 @@ +// +// Created by yelv1 on 24-9-23. +// + +#ifndef INPUT_CAPTURE_EXP_H +#define INPUT_CAPTURE_EXP_H + +#endif //INPUT_CAPTURE_EXP_H diff --git a/src/input_capture_exp.c b/src/input_capture_exp.c new file mode 100644 index 0000000..7f9586f --- /dev/null +++ b/src/input_capture_exp.c @@ -0,0 +1,7 @@ +// +// Created by yelv1 on 24-9-23. +// + +#include "input_capture_exp.h" +#include "gd32e23x.h" + diff --git a/src/main.c b/src/main.c index 8ebb333..4c837d8 100644 --- a/src/main.c +++ b/src/main.c @@ -25,8 +25,8 @@ int main(void) /* configure systick */ systick_config(); /* configure ultrasonic board hardware */ - ultrasonic_config(); - + // ultrasonic_config(); + usart_config(); /* ---------- debug start ---------- */ @@ -43,9 +43,7 @@ int main(void) while(1) { - delay_ms(50); - ultrasonic_pwm_out_cycles(ULTRASONIC_CYCLES); - // printf("Send ultra sonic driver signal!\r\n"); + } }