#include #ifdef STA_HAL_UART_ENABLE #include namespace sta { HalUART::HalUART(UART_HandleTypeDef * handle) : handle_{handle} { STA_ASSERT(handle != nullptr); } void HalUART::write(const uint8_t * buffer, size_t size) { STA_ASSERT(buffer != nullptr); HAL_UART_Transmit(handle_, const_cast(buffer), size, HAL_MAX_DELAY); } } // namespace sta #ifdef STA_HAL_UART_DEBUG_SERIAL // Get extern declaration for DebugSerial because const namespace level variables have internal linkage by default #include #include namespace sta { HalUART gHalDebugSerial(&STA_HAL_UART_DEBUG_SERIAL); // Used by PrintableUART DebugSerial(&gHalDebugSerial); } // namespace sta #endif // STA_HAL_UART_DEBUG_SERIAL #endif // STA_HAL_UART_ENABLE