重构 SerialPort 类,移除静态成员,改为实例成员,优化 UART 读写方法

This commit is contained in:
2025-05-10 18:58:02 +08:00
parent 52a4669c0d
commit b4ecf03e95
3 changed files with 31 additions and 83 deletions

View File

@@ -17,7 +17,6 @@ extern "C" void AppStart() {
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);
}
}