diff --git a/Peripherals/Inc/peripherals_hal_st.hpp b/Peripherals/Inc/peripherals_hal_st.hpp index 0a369f4..fc08092 100644 --- a/Peripherals/Inc/peripherals_hal_st.hpp +++ b/Peripherals/Inc/peripherals_hal_st.hpp @@ -262,10 +262,30 @@ struct SpiRegisters #ifdef HAL_UART_MODULE_ENABLED +namespace _Details +{ + +/** + * @hack: Temporary workarounds to make the HAL compile for FW1.27. ST made it so that only UART libraries + * are const-correct. The others remain unconst. So these wrappers will exist until we're no longer partially + * const-correct. + */ +inline HAL_StatusTypeDef uartTransmit(UART_HandleTypeDef *huart, std::uint8_t *data, const std::uint16_t size, const std::uint32_t timeout) +{ + return HAL_UART_Transmit(huart, data, size, timeout); +} + +inline HAL_StatusTypeDef uartTransmitDma(UART_HandleTypeDef *huart, std::uint8_t *data, const std::uint16_t size) +{ + return HAL_UART_Transmit_DMA(huart, data, size); +} + +} + using UartInterface = - SerialInterface; + SerialInterface; using UartInterfaceDMA = - SerialInterfaceAsync; #endif// HAL_UART_MODULE_ENABLED