添加串口操作类
Some checks failed
Build and Upload Artifact / build and upload-artifact (push) Failing after 13s

This commit is contained in:
chauyin
2025-05-06 22:34:51 +08:00
parent 2018adcf78
commit c7a965ed3c
18 changed files with 22698 additions and 30 deletions

21
Core/App/app.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "Helper/delay_helper.h"
#include "stm32h563xx.h"
#include "Common/serial_port.hpp"
#include "Helper/gpio_helper.hpp"
void Setup() {
GpioHelper::EnableAllGpioPeripheral();
DelaySetup();
}
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::WriteLine("LED is toggled,current state: %s", gpio.Read() ? "OFF" : "ON");
DelayS(1);
}
}