Commit 656cb012 authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Kumar Gala
Browse files

ext/hal: stm32f1xx: Use of (__packed uint32_t *) produces warnings



Using Zephyr SDK 0.10.0-rc2, GNUCC 8.2.0 is used and
(__packed uint32_t *) are now generating warnings..
Replace with CMSIS macros __UNALIGNED_UINT32_READ and
__UNALIGNED_UINT32_WRITE

ST internal reference: 61323

Signed-off-by: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent 83a24ef7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -52,3 +52,11 @@ Patch List:
     Impacted files:
      drivers/include/stm32f1xx_ll_rcc.h
     ST Bug tracker ID: 37419

    *Use of (__packed uint32_t *) produces warning
      Using GNU 8.2.0, (__packed uint32_t *) generates warning.
      Replace with CMSIS macros __UNALIGNED_UINT32_READ and
      __UNALIGNED_UINT32_WRITE.
     Impacted files:
      drivers/include/stm32f1xx_ll_usb.c
     ST Bug tracker ID: 61323
+2 −2
Original line number Diff line number Diff line
@@ -653,7 +653,7 @@ HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uin
  count32b =  (len + 3) / 4;
  for (index = 0; index < count32b; index++, src += 4)
  {
    USBx_DFIFO(ch_ep_num) = *((__packed uint32_t *)src);
    USBx_DFIFO(ch_ep_num) = __UNALIGNED_UINT32_READ(src);
  }
  return HAL_OK;
}
@@ -675,7 +675,7 @@ void *USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len)

  for ( index = 0; index < count32b; index++, dest += 4 )
  {
    *(__packed uint32_t *)dest = USBx_DFIFO(0);
    __UNALIGNED_UINT32_WRITE(dest, USBx_DFIFO(0));

  }
  return ((void *)dest);