Make Timeout of 0 work as intended (no timeout)

This commit is contained in:
Stefan `Sec` Zehl 2011-08-03 18:19:07 +02:00
parent 3542f8acd6
commit 11ae0a5b9a
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,8 @@ uint8_t getInputWait(void) {
uint8_t getInputWaitTimeout(int timeout) { uint8_t getInputWaitTimeout(int timeout) {
uint8_t key; uint8_t key;
if(timeout==0)
return getInputWait();
int end=_timectr+timeout*(1000/SYSTICKSPEED); int end=_timectr+timeout*(1000/SYSTICKSPEED);
while ((key=getInputRaw())==BTN_NONE){ while ((key=getInputRaw())==BTN_NONE){
if(_timectr>end) if(_timectr>end)