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