添加串口操作类
Some checks failed
Build and Upload Artifact / build and upload-artifact (push) Failing after 13s
Some checks failed
Build and Upload Artifact / build and upload-artifact (push) Failing after 13s
This commit is contained in:
21
Core/App/app.cpp
Normal file
21
Core/App/app.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user