Adding variable button timeout.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-09-22 19:22:44 +02:00
parent 4ab68cc822
commit d2e54b04db
2 changed files with 4 additions and 1 deletions

View File

@@ -73,6 +73,8 @@ bool is_req_button_pending() {
return req_button_pending;
}
uint32_t button_timeout = 15000;
bool wait_button() {
uint32_t start_button = board_millis();
bool timeout = false;
@@ -81,7 +83,7 @@ bool wait_button() {
while (board_button_read() == false) {
execute_tasks();
//sleep_ms(10);
if (start_button + 15000 < board_millis()) { /* timeout */
if (start_button + button_timeout < board_millis()) { /* timeout */
timeout = true;
break;
}