touch: Reinitialize up to 3 times if failed

This commit is contained in:
CTCaer committed 2020-04-14 17:52:22 +03:00
1 parent 9af4c717a8
commit da149c296f
1 file changed
+10 -1
+10 -1
View File
@@ -373,7 +373,16 @@ int touch_power_on()
return touch_execute_autotune(); return touch_execute_autotune();
} }
return touch_init(); // Initialize touchscreen.
u32 retries = 3;
while (retries)
{
if (touch_init())
return 1;
retries--;
}
return 0;
} }
void touch_power_off() void touch_power_off()