From c6e2cfecce019d70ed5de74611761a2546e34828 Mon Sep 17 00:00:00 2001 From: bigbiff Date: Fri, 26 Jun 2020 16:14:32 -0400 Subject: [PATCH] minuitwrp ev_init: delay start if specified in board This setting in the board will help if it takes longer for the touchscreen driver to initialize. Use TW_DELAY_TOUCH_INIT_MS := nnnn where nnnn is in MS. Change-Id: I0a5c602edfe1214d64adadc980921a7bc0aa2bc5 --- gui/Android.mk | 4 ++++ gui/gui.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/gui/Android.mk b/gui/Android.mk index 2243ba80b9..b9ff2666c1 100755 --- a/gui/Android.mk +++ b/gui/Android.mk @@ -32,6 +32,10 @@ LOCAL_SRC_FILES := \ terminal.cpp \ twmsg.cpp +ifneq ($(TW_DELAY_TOUCH_INIT_MS),) + LOCAL_CFLAGS += -DTW_DELAY_TOUCH_INIT_MS=$(TW_DELAY_TOUCH_INIT_MS) +endif + ifneq ($(TWRP_CUSTOM_KEYBOARD),) LOCAL_SRC_FILES += $(TWRP_CUSTOM_KEYBOARD) else diff --git a/gui/gui.cpp b/gui/gui.cpp index cd6fa59734..beed15e568 100644 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -771,6 +771,9 @@ extern "C" int gui_init(void) PageManager::ReleasePackage("splash"); } +#ifdef TW_DELAY_TOUCH_INIT_MS + usleep(TW_DELAY_TOUCH_INIT_MS); +#endif ev_init(); return 0; }