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
diff --git a/gui/Android.mk b/gui/Android.mk
index 2243ba8..b9ff266 100755
--- a/gui/Android.mk
+++ b/gui/Android.mk
@@ -32,6 +32,10 @@
     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 cd6fa59..beed15e 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -771,6 +771,9 @@
 		PageManager::ReleasePackage("splash");
 	}
 
+#ifdef TW_DELAY_TOUCH_INIT_MS
+	usleep(TW_DELAY_TOUCH_INIT_MS);
+#endif
 	ev_init();
 	return 0;
 }