Fixed screen brightness problems (tested on 1.0.0 and 2.0.0). Some refactoring.
This commit is contained in:
11
ipl/btn.c
11
ipl/btn.c
@@ -37,22 +37,21 @@ u32 btn_wait()
|
||||
u32 res = 0, btn = btn_read();
|
||||
int pwr = 0;
|
||||
|
||||
// Power button down, raise a filter.
|
||||
//Power button down, raise a filter.
|
||||
if (btn & BTN_POWER)
|
||||
{
|
||||
pwr = 1;
|
||||
btn &= 0xFFFFFFFE;
|
||||
btn &= ~BTN_POWER;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
res = btn_read();
|
||||
// Power button up, remove filter.
|
||||
//Power button up, remove filter.
|
||||
if (!(res & BTN_POWER) && pwr)
|
||||
pwr = 0;
|
||||
// Power button still down.
|
||||
else if (pwr)
|
||||
res &= 0xFFFFFFFE;
|
||||
else if (pwr) //Power button still down.
|
||||
res &= ~BTN_POWER;
|
||||
} while (btn == res);
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user