mbed SDK library sources
Fork of mbed-src by
Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.
If you are looking for a stable and tested release, please import one of the official mbed library releases:
Import librarymbed
The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Diff: targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_lcd.c
- Revision:
- 80:66393a7b209d
- Parent:
- 76:aeb1df146756
--- a/targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_lcd.c Thu Jan 30 09:45:05 2014 +0000 +++ b/targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_lcd.c Thu Jan 30 12:15:05 2014 +0000 @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32l1xx_lcd.c * @author MCD Application Team - * @version V1.2.0 - * @date 22-February-2013 + * @version V1.3.0 + * @date 31-January-2014 * @brief This file provides firmware functions to manage the following * functionalities of the LCD controller (LCD) peripheral: * + Initialization and configuration @@ -61,7 +61,7 @@ ****************************************************************************** * @attention * - * <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2> + * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. @@ -129,6 +129,8 @@ #define BLINK_MASK ((uint32_t)0xFFFC1FFF) /* LCD BLINK Mask */ #define CONTRAST_MASK ((uint32_t)0xFFFFE3FF) /* LCD CONTRAST Mask */ +#define SYNCHRO_TIMEOUT ((uint32_t) 0x00008000) + /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ @@ -236,10 +238,15 @@ */ void LCD_WaitForSynchro(void) { + uint32_t synchrocounter = 0; + uint32_t synchrostatus = 0x00; + /* Loop until FCRSF flag is set */ - while ((LCD->SR & LCD_FLAG_FCRSF) == (uint32_t)RESET) + do { - } + synchrostatus = LCD->SR & LCD_FLAG_FCRSF; + synchrocounter++; + } while((synchrocounter != SYNCHRO_TIMEOUT) && (synchrostatus == 0x00)); } /**