configs/stm32f429i-disco/src/stm32_lcd.c: Handle multiple calls to up_fbinitialize()
This commit is contained in:
parent
1f22ebfac3
commit
28115504ec
@ -39,6 +39,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
@ -528,25 +529,30 @@ int board_lcd_initialize(void)
|
||||
|
||||
int up_fbinitialize(int display)
|
||||
{
|
||||
#ifdef CONFIG_STM32F429I_DISCO_ILI9341_FBIFACE
|
||||
static bool initialized = false;
|
||||
int ret;
|
||||
|
||||
/* Initialize the ili9341 LCD controller */
|
||||
|
||||
ret = stm32_ili9341_initialize();
|
||||
|
||||
if (ret == OK)
|
||||
if (!initialized)
|
||||
{
|
||||
#ifdef CONFIG_STM32F429I_DISCO_ILI9341_FBIFACE
|
||||
/* Initialize the ili9341 LCD controller */
|
||||
|
||||
ret = stm32_ili9341_initialize();
|
||||
if (ret >= OK)
|
||||
{
|
||||
ret = stm32_ltdcinitialize();
|
||||
}
|
||||
|
||||
#else
|
||||
/* Custom LCD display with RGB interface */
|
||||
|
||||
ret = stm32_ltdcinitialize();
|
||||
#endif
|
||||
|
||||
initialized = (ret >= OK);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
#else
|
||||
/* Custom LCD display with RGB interface */
|
||||
|
||||
return stm32_ltdcinitialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -73,6 +73,7 @@
|
||||
int up_fbinitialize(int display)
|
||||
{
|
||||
/* Custom LCD display with RGB interface */
|
||||
|
||||
stm32_configgpio(GPIO_LCD_DISP);
|
||||
stm32_configgpio(GPIO_LCD_BL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user