X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcc1111%2Fao_button.c;h=0496a32f270454b95935017896c318eec98482bc;hb=c408c773793b5a5685d95c11ba6f710200505c25;hp=69f3475fe660d43125073a40b19118f3f545c07d;hpb=4de8bf6da4d725bb0514d032b0708c5cf420e8fa;p=fw%2Faltos diff --git a/src/cc1111/ao_button.c b/src/cc1111/ao_button.c index 69f3475f..0496a32f 100644 --- a/src/cc1111/ao_button.c +++ b/src/cc1111/ao_button.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -72,12 +73,12 @@ ao_button_mask(uint8_t reg) } char -ao_button_get(void) __critical +ao_button_get(uint16_t timeout) __critical { char b; while (ao_fifo_empty(ao_button_fifo)) - if (ao_sleep(&ao_button_fifo)) + if (ao_sleep_for(&ao_button_fifo, timeout)) return 0; ao_fifo_remove(ao_button_fifo, b); return b;