From 21eec9089e9e9adfe2b5d39251374b948bd46438 Mon Sep 17 00:00:00 2001 From: chauyin Date: Sat, 10 May 2025 19:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20App=20=E7=B1=BB=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E6=9E=84=20Setup=20=E5=92=8C=20AppStart=20=E5=87=BD?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E6=B8=85=E7=90=86=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=A2=9E=E5=BC=BA=E5=8F=AF?= =?UTF-8?q?=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/App/app.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Core/App/app.cpp b/Core/App/app.cpp index 3346448..9240eac 100644 --- a/Core/App/app.cpp +++ b/Core/App/app.cpp @@ -1,24 +1,36 @@ #include "Helper/delay_helper.h" #include "stm32h563xx.h" -#include "Common/serial_port.hpp" -#include "Helper/gpio_helper.hpp" #include "Center/common_center.hpp" +#include "Helper/gpio_helper.hpp" +#include "Helper/delay_helper.h" +void TerminateHandler() { + auto led = GpioHelper::GpioInit(GPIOB, GPIO_PIN_0, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_PIN_SET); + while (true) { + led.Toggle(); + DelayS(1); + } +} void Setup() { GpioHelper::EnableAllGpioPeripheral(); DelaySetup(); auto ultrasonic = CommonCenter::GetUltrasonic(); - auto dfPlayer = CommonCenter::GetDfPlayer(); - auto canMv = CommonCenter::GetCanMv(); + auto dfPlayer = CommonCenter::GetDfPlayer(); + auto canMv = CommonCenter::GetCanMv(); } extern "C" void AppStart() { Setup(); - auto gpio = GpioHelper::GpioInit(GPIOB, GPIO_PIN_0, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_PIN_SET); + auto ultrasonic = CommonCenter::GetUltrasonic(); + auto dfPlayer = CommonCenter::GetDfPlayer(); + auto canMv = CommonCenter::GetCanMv(); while (true) { - gpio.Toggle(); - DelayS(1); + // Example usage of the classes + ultrasonic.GetDistance(); + dfPlayer.PlayTrack(1); + + DelayMs(1000); // Delay for 1 second } }