1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/auto_init: add mechanism for auto_init_screen

This commit is contained in:
Alexandre Abadie 2020-06-21 18:26:14 +02:00
parent 7e1d4c323a
commit bbe0c94167
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
5 changed files with 60 additions and 0 deletions

View File

@ -305,5 +305,6 @@ NO_PSEUDOMODULES += auto_init_loramac
NO_PSEUDOMODULES += auto_init_multimedia
NO_PSEUDOMODULES += auto_init_security
NO_PSEUDOMODULES += auto_init_usbus
NO_PSEUDOMODULES += auto_init_screen
# Packages may also add modules to PSEUDOMODULES in their `Makefile.include`.

View File

@ -26,4 +26,8 @@ ifneq (,$(filter auto_init_security,$(USEMODULE)))
DIRS += security
endif
ifneq (,$(filter auto_init_screen,$(USEMODULE)))
DIRS += screen
endif
include $(RIOTBASE)/Makefile.base

View File

@ -270,4 +270,10 @@ void auto_init(void)
auto_init_dfplayer();
}
}
if (IS_USED(MODULE_AUTO_INIT_SCREEN)) {
LOG_DEBUG("Auto init screen devices\n");
extern void auto_init_screen(void);
auto_init_screen();
}
}

View File

@ -0,0 +1,3 @@
MODULE = auto_init_screen
include $(RIOTMAKE)/auto_init.inc.mk

View File

@ -0,0 +1,46 @@
/*
* Copyright (C) 2020 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup sys_auto_init
* @{
* @file
* @brief automatically initializes screen display and touch devices
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @}
*/
#include <stdio.h>
#define ENABLE_DEBUG (0)
#include "debug.h"
void auto_init_screen(void)
{
if (IS_USED(MODULE_DISP_DEV)) {
DEBUG("auto_init_screen: init display drivers\n");
if (IS_USED(MODULE_ILI9341)) {
extern void auto_init_ili9341(void);
auto_init_ili9341();
}
}
if (IS_USED(MODULE_TOUCH_DEV)) {
DEBUG("auto_init_screen: init touch drivers\n");
if (IS_USED(MODULE_STMPE811)) {
extern void auto_init_stmpe811(void);
auto_init_stmpe811();
}
}
if (IS_USED(MODULE_LVGL)) {
extern void auto_init_lvgl(void);
auto_init_lvgl();
}
}