diff --git a/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_can_legacy.c b/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_can_legacy.c index 7e93892d6a..3b88ba4f2f 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_can_legacy.c +++ b/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_can_legacy.c @@ -120,7 +120,7 @@ #error 'The HAL CAN driver cannot be used with its legacy, Please ensure to enable only one HAL CAN module at once in stm32l4xx_hal_conf.h file' #endif /* HAL_CAN_MODULE_ENABLED */ -#warning 'Legacy HAL CAN driver is enabled! It can be used with known limitations, refer to the release notes. However it is recommended to use rather the new HAL CAN driver' +// #warning 'Legacy HAL CAN driver is enabled! It can be used with known limitations, refer to the release notes. However it is recommended to use rather the new HAL CAN driver' #if defined(CAN1) diff --git a/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_ll_spi.h b/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_ll_spi.h index b88bcd537c..108715f153 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_ll_spi.h +++ b/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_ll_spi.h @@ -1376,6 +1376,14 @@ __STATIC_INLINE void LL_SPI_TransmitData8(SPI_TypeDef *SPIx, uint8_t TxData) *((__IO uint8_t *)&SPIx->DR) = TxData; } +#if __GNUC__ +# define MAY_ALIAS __attribute__ ((__may_alias__)) +#else +# define MAY_ALIAS +#endif + +typedef __IO uint16_t MAY_ALIAS uint16_io_t; + /** * @brief Write 16-Bits in the data register * @rmtoll DR DR LL_SPI_TransmitData16 @@ -1385,7 +1393,7 @@ __STATIC_INLINE void LL_SPI_TransmitData8(SPI_TypeDef *SPIx, uint8_t TxData) */ __STATIC_INLINE void LL_SPI_TransmitData16(SPI_TypeDef *SPIx, uint16_t TxData) { - *((__IO uint16_t *)&SPIx->DR) = TxData; + *((uint16_io_t*)&SPIx->DR) = TxData; } /** diff --git a/targets/TARGET_STM/TARGET_STM32L4/serial_device.c b/targets/TARGET_STM/TARGET_STM32L4/serial_device.c index c56f854be3..ac9bc85d1f 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/serial_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/serial_device.c @@ -46,7 +46,7 @@ UART_HandleTypeDef uart_handlers[UART_NUM]; static uart_irq_handler irq_handler; // Defined in serial_api.c -inline int8_t get_uart_index(UARTName uart_name); +extern int8_t get_uart_index(UARTName uart_name); /****************************************************************************** * INTERRUPTS HANDLING