Temporary workaround for FW1.27
This commit is contained in:
parent
6e22b02e92
commit
d10675e3ec
@ -262,10 +262,30 @@ struct SpiRegisters
|
|||||||
|
|
||||||
#ifdef HAL_UART_MODULE_ENABLED
|
#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 =
|
using UartInterface =
|
||||||
SerialInterface<UART_HandleTypeDef, HAL_UART_Transmit, HAL_UART_Receive>;
|
SerialInterface<UART_HandleTypeDef, _Details::uartTransmit, HAL_UART_Receive>;
|
||||||
using UartInterfaceDMA =
|
using UartInterfaceDMA =
|
||||||
SerialInterfaceAsync<UART_HandleTypeDef, HAL_UART_Transmit_DMA,
|
SerialInterfaceAsync<UART_HandleTypeDef, _Details::uartTransmitDma,
|
||||||
HAL_UART_Receive_DMA>;
|
HAL_UART_Receive_DMA>;
|
||||||
|
|
||||||
#endif// HAL_UART_MODULE_ENABLED
|
#endif// HAL_UART_MODULE_ENABLED
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user