touch: Reinitialize up to 3 times if failed

This commit is contained in:
CTCaer 2020-04-14 17:52:22 +03:00
parent 9af4c717a8
commit da149c296f

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()