From 5d6473c3a80a4352a1e301e22d32830a8a0a51f5 Mon Sep 17 00:00:00 2001 From: Sakib Ahmed Sumdany Date: Mon, 24 Jul 2017 09:21:59 +0600 Subject: [PATCH] compatibility issue with the ESP8266 Arduino core because it uses a busy loop. --- src/Keypad.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Keypad.cpp b/src/Keypad.cpp index f146a6d..1ae8b56 100644 --- a/src/Keypad.cpp +++ b/src/Keypad.cpp @@ -210,8 +210,10 @@ int Keypad::findInList (int keyCode) { // New in 2.0 char Keypad::waitForKey() { char waitKey = NO_KEY; - while( (waitKey = getKey()) == NO_KEY ); // Block everything while waiting for a keypress. - return waitKey; + while( (waitKey = getKey()) == NO_KEY ){ // Block everything while waiting for a keypress. + delay(0); + return waitKey; + } } // Backwards compatibility function.