]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil/ST_Library/stm32f7xx_hal_i2s.c
Update library files used in STM32F7 demo to the latest version released by ST.
[freertos] / FreeRTOS / Demo / CORTEX_M7_STM32F7_STM32756G-EVAL_IAR_Keil / ST_Library / stm32f7xx_hal_i2s.c
index 32747201b4442e12d6d46cdfdc8e125fe4c43e31..2b6b77e0038470ad70f3a8c58b7ab16726a298a8 100644 (file)
@@ -2,8 +2,8 @@
   ******************************************************************************\r
   * @file    stm32f7xx_hal_i2s.c\r
   * @author  MCD Application Team\r
-  * @version V1.0.0RC1\r
-  * @date    24-March-2015\r
+  * @version V1.0.0\r
+  * @date    12-May-2015\r
   * @brief   I2S HAL module driver.\r
   *          This file provides firmware functions to manage the following \r
   *          functionalities of the Integrated Interchip Sound (I2S) peripheral:\r
 /* Includes ------------------------------------------------------------------*/\r
 #include "stm32f7xx_hal.h"\r
 \r
-/** @addtogroup STM32F3xx_HAL_Driver\r
+/** @addtogroup STM32F7xx_HAL_Driver\r
   * @{\r
   */\r
 \r
-/** @defgroup I2S I2S HAL module driver\r
+/** @defgroup I2S I2S\r
   * @brief I2S HAL module driver\r
   * @{\r
   */\r
@@ -234,11 +234,16 @@ HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s)
   assert_param(IS_I2S_CPOL(hi2s->Init.CPOL));  \r
   assert_param(IS_I2S_CLOCKSOURCE(hi2s->Init.ClockSource));\r
   \r
-  hi2s->State = HAL_I2S_STATE_BUSY;\r
-  \r
-  /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */\r
-  HAL_I2S_MspInit(hi2s);\r
+  if(hi2s->State == HAL_I2S_STATE_RESET)\r
+  {\r
+    /* Allocate lock resource and initialize it */\r
+    hi2s->Lock = HAL_UNLOCKED;\r
+    /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */\r
+    HAL_I2S_MspInit(hi2s);\r
+  }\r
   \r
+  hi2s->State = HAL_I2S_STATE_BUSY;\r
+    \r
   /*----------------------- SPIx I2SCFGR & I2SPR Configuration -----------------*/\r
   /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */\r
   hi2s->Instance->I2SCFGR &= ~(SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CKPOL | \\r
@@ -1300,7 +1305,7 @@ uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s)
 \r
   /**\r
   * @brief  Get I2S Input Clock based on I2S source clock selection\r
-  * @param  hsai: pointer to a I2S_HandleTypeDef structure that contains\r
+  * @param  hi2s: pointer to a I2S_HandleTypeDef structure that contains\r
   *               the configuration information for I2S module.   \r
   * @retval I2S Clock Input \r
   */\r