autoboot: Support VOL-+ combo for fastboot
This is conditional: In order to not cancel booting while trying to enter fastboot in android, the combo MUST be initiated with `VOL+` (hold) -> `VOL-` (hold)
This commit is contained in:
@@ -61,16 +61,25 @@ u8 btn_wait()
|
||||
|
||||
u8 btn_wait_timeout(u32 time_ms, u8 mask)
|
||||
{
|
||||
u8 single_button = mask & BTN_SINGLE;
|
||||
mask &= ~BTN_SINGLE;
|
||||
|
||||
u32 timeout = get_tmr_ms() + time_ms;
|
||||
u8 res = btn_read() & mask;
|
||||
u8 res = btn_read();
|
||||
|
||||
while (get_tmr_ms() < timeout)
|
||||
{
|
||||
if (res == mask)
|
||||
break;
|
||||
if ((res & mask) == mask)
|
||||
{
|
||||
if (single_button && (res & ~mask)) // Undesired button detected.
|
||||
res = btn_read();
|
||||
else
|
||||
return (res & mask);
|
||||
}
|
||||
else
|
||||
res = btn_read() & mask;
|
||||
res = btn_read();
|
||||
};
|
||||
|
||||
return res;
|
||||
// Timed out.
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user