stm32l1xx_ll_spi.h BUG and Warning
Dear Sirs
File : stm32l1xx_ll_spi.hVery ugly BUG !!!!
__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&sharpif defined(GPIO_BRR_BR_0) !!!!!!! Correct :(GPIO_BRR) !!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WRITE_REG(GPIOx->BRR, PinMask);
&sharpelse WRITE_REG(GPIOx->BSRR, (PinMask << 16));&sharpendif /* GPIO_BRR_BR_0 */}OpenSTM32 rise a warning :
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32L100xC
stm32l1xx_ll_spi.h:1137:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
__STATIC_INLINE void LL_SPI_TransmitData16(SPI_TypeDef *SPIx, uint16_t TxData)
{ *((__IO uint16_t *)&SPIx->DR) = TxData;}This code compiled without warning :
__STATIC_INLINE void LL_SPI_TransmitData8(SPI_TypeDef *SPIx, uint8_t TxData)
{ *((__IO uint8_t *)&SPIx->DR) = TxData;}Thanks
Tibor Kiss
#stm32l1xx_ll_spi.h-warning