Make getInputWaitTimeout use microseconds
This commit is contained in:
parent
81815b1eef
commit
c2d7656a1e
|
@ -54,7 +54,7 @@ uint8_t getInputWaitTimeout(int timeout) {
|
||||||
uint8_t key;
|
uint8_t key;
|
||||||
if(timeout==0)
|
if(timeout==0)
|
||||||
return getInputWait();
|
return getInputWait();
|
||||||
int end=_timectr+timeout*(1000/SYSTICKSPEED);
|
int end=_timectr+timeout/SYSTICKSPEED;
|
||||||
while ((key=getInputRaw())==BTN_NONE){
|
while ((key=getInputRaw())==BTN_NONE){
|
||||||
if(_timectr>end)
|
if(_timectr>end)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -46,7 +46,7 @@ void handleMenu(const struct MENU *the_menu) {
|
||||||
}
|
}
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
|
|
||||||
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15:0)) {
|
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15000:0)) {
|
||||||
case BTN_UP:
|
case BTN_UP:
|
||||||
menuselection--;
|
menuselection--;
|
||||||
if (menuselection < current_offset) {
|
if (menuselection < current_offset) {
|
||||||
|
|
|
@ -127,7 +127,7 @@ static bool screen_intro() {
|
||||||
DoString (0, 9, highnick);
|
DoString (0, 9, highnick);
|
||||||
lcdDisplay();
|
lcdDisplay();
|
||||||
step = !step;
|
step = !step;
|
||||||
key=getInputWaitTimeout(1);
|
key=getInputWaitTimeout(1000);
|
||||||
}
|
}
|
||||||
return !(key==BTN_LEFT);
|
return !(key==BTN_LEFT);
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ static bool screen_gameover() {
|
||||||
if (highscore_set(game.score, GLOBAL(nickname)))
|
if (highscore_set(game.score, GLOBAL(nickname)))
|
||||||
DoString (0,9,"HIGHSCORE!");
|
DoString (0,9,"HIGHSCORE!");
|
||||||
lcdDisplay();
|
lcdDisplay();
|
||||||
key=getInputWaitTimeout(5);
|
key=getInputWaitTimeout(5000);
|
||||||
}
|
}
|
||||||
return !(key==BTN_LEFT);
|
return !(key==BTN_LEFT);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue