#include #ifdef STA_STM32_UART_ENABLE #include namespace sta { STM32UART::STM32UART(UART_HandleTypeDef * handle) : handle_{handle} { STA_ASSERT(handle != nullptr); } void STM32UART::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_STM32_UART_DEBUG_SERIAL // Get extern declaration for DebugSerial because const namespace level variables have internal linkage by default #include #include namespace sta { STM32UART gStm32DebugSerial(&STA_STM32_UART_DEBUG_SERIAL); // Used by PrintableUART DebugSerial(&gStm32DebugSerial); } // namespace sta #endif // STA_STM32_UART_DEBUG_SERIAL #endif // STA_STM32_UART_ENABLE