From d10675e3ec451d4215a7e3846ccb324af0ff13d4 Mon Sep 17 00:00:00 2001 From: Erki Date: Tue, 6 Sep 2022 23:38:33 +0300 Subject: [PATCH] Temporary workaround for FW1.27 --- Peripherals/Inc/peripherals_hal_st.hpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) 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