mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
configs/stm32f429i-disco/src/stm32_lcd.c: Handle multiple calls to up_fbinitialize()
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
@@ -528,25 +529,30 @@ int board_lcd_initialize(void)
|
|||||||
|
|
||||||
int up_fbinitialize(int display)
|
int up_fbinitialize(int display)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_STM32F429I_DISCO_ILI9341_FBIFACE
|
static bool initialized = false;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Initialize the ili9341 LCD controller */
|
if (!initialized)
|
||||||
|
|
||||||
ret = stm32_ili9341_initialize();
|
|
||||||
|
|
||||||
if (ret == OK)
|
|
||||||
{
|
{
|
||||||
|
#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();
|
ret = stm32_ltdcinitialize();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
initialized = (ret >= OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#else
|
|
||||||
/* Custom LCD display with RGB interface */
|
|
||||||
|
|
||||||
return stm32_ltdcinitialize();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
int up_fbinitialize(int display)
|
int up_fbinitialize(int display)
|
||||||
{
|
{
|
||||||
/* Custom LCD display with RGB interface */
|
/* Custom LCD display with RGB interface */
|
||||||
|
|
||||||
stm32_configgpio(GPIO_LCD_DISP);
|
stm32_configgpio(GPIO_LCD_DISP);
|
||||||
stm32_configgpio(GPIO_LCD_BL);
|
stm32_configgpio(GPIO_LCD_BL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user