#include "Helper/delay_helper.h"
#include "stm32h563xx.h"

#include "Common/serial_port.hpp"
#include "Helper/gpio_helper.hpp"
#include "Center/common_center.hpp"


void Setup() {
    GpioHelper::EnableAllGpioPeripheral();
    DelaySetup();
    auto ultrasonic = CommonCenter::GetUltrasonic();
}

extern "C" void AppStart() {
    Setup();
    auto gpio = GpioHelper::GpioInit(GPIOB, GPIO_PIN_0, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_PIN_SET);
    while (true) {
        gpio.Toggle();
        SerialPort::WriteBlocking("LED is toggled,current state: %s", gpio.Read() ? "OFF" : "ON");
        DelayS(1);
    }
}
