diff --git a/Core/App/Common/serial_port.hpp b/Core/App/Common/serial_port.hpp index a3abe7f..550ce44 100644 --- a/Core/App/Common/serial_port.hpp +++ b/Core/App/Common/serial_port.hpp @@ -49,7 +49,7 @@ public: return result; } - static void WriteLine(const char* format, ...) { + static void WriteLineDMA(const char* format, ...) { WaitTransmit(); isTransmitting = true; va_list args; @@ -79,7 +79,7 @@ public: HAL_UART_Transmit(kHandle, reinterpret_cast(buffer), len, kTransmitTimeout); } - static void Write(const char* format, ...) { + static void WriteDMA(const char* format, ...) { WaitTransmit(); isTransmitting = true; va_list args; @@ -105,7 +105,7 @@ public: HAL_UART_Transmit(kHandle, reinterpret_cast(buffer), strlen(buffer), kTransmitTimeout); } - static void WriteBytes(const uint8_t* data, size_t size) { + static void WriteBytesDMA(const uint8_t* data, size_t size) { WaitTransmit(); isTransmitting = true; HAL_UART_Transmit_DMA(kHandle, const_cast(data), size); diff --git a/Core/App/app.cpp b/Core/App/app.cpp index e7efc6e..d2ef5f1 100644 --- a/Core/App/app.cpp +++ b/Core/App/app.cpp @@ -15,7 +15,7 @@ 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::WriteLine("LED is toggled,current state: %s", gpio.Read() ? "OFF" : "ON"); + SerialPort::WriteBlocking("LED is toggled,current state: %s", gpio.Read() ? "OFF" : "ON"); DelayS(1); } }