mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
186:707f6e361f3e
Parent:
151:5eaa88a5bcc7
--- a/targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_hal_crc.c	Thu Apr 19 17:12:19 2018 +0100
+++ b/targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_hal_crc.c	Fri Jun 22 16:45:37 2018 +0100
@@ -2,8 +2,6 @@
   ******************************************************************************
   * @file    stm32l0xx_hal_crc.c
   * @author  MCD Application Team
-  * @version V1.7.0
-  * @date    31-May-2016
   * @brief   CRC HAL module driver.
   *    
   *          This file provides firmware functions to manage the following 
@@ -228,13 +226,16 @@
   
   /* Reset CRC calculation unit */
   __HAL_CRC_DR_RESET(hcrc);
+  
+  /* Reset IDR register content */
+  CLEAR_BIT(hcrc->Instance->IDR, CRC_IDR_IDR) ;
 
   /* DeInit the low level hardware */
   HAL_CRC_MspDeInit(hcrc);
 
   /* Change CRC peripheral state */
   hcrc->State = HAL_CRC_STATE_RESET;
- 
+
   /* Process unlocked */
   __HAL_UNLOCK(hcrc);
 
@@ -421,7 +422,14 @@
   return temp;
 }
 
+#if __GNUC__
+#    define MAY_ALIAS __attribute__ ((__may_alias__))
+#else
+#    define MAY_ALIAS
+#endif
 
+typedef __IO uint8_t  MAY_ALIAS uint8_io_t;
+typedef __IO uint16_t MAY_ALIAS uint16_io_t;
 
 /**
   * @}
@@ -486,16 +494,16 @@
    {
      if  (BufferLength%4U == 1U)
      {
-       *(uint8_t volatile*) (&hcrc->Instance->DR) = pBuffer[4U*i];
+       *(uint8_io_t*) (&hcrc->Instance->DR) = pBuffer[4U*i];
      }
      if  (BufferLength%4U == 2U)
      {
-       *(uint16_t volatile*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4U*i]<<8U) | (uint32_t)pBuffer[4U*i+1U];
+       *(uint16_io_t*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4U*i]<<8U) | (uint32_t)pBuffer[4U*i+1U];
      }
      if  (BufferLength%4U == 3U)
      {
-       *(uint16_t volatile*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4U*i]<<8U) | (uint32_t)pBuffer[4U*i+1U];
-       *(uint8_t volatile*) (&hcrc->Instance->DR) = pBuffer[4U*i+2U];
+       *(uint16_io_t*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4U*i]<<8U) | (uint32_t)pBuffer[4U*i+1U];
+       *(uint8_io_t*) (&hcrc->Instance->DR) = pBuffer[4U*i+2U];
      }
    }
   
@@ -524,7 +532,7 @@
   }
   if ((BufferLength%2U) != 0U)
   {
-       *(uint16_t volatile*) (&hcrc->Instance->DR) = pBuffer[2U*i];
+       *(uint16_io_t*) (&hcrc->Instance->DR) = pBuffer[2U*i];
   }
    
   /* Return the CRC computed value */