diff --git a/src/gruvin9x.cpp b/src/gruvin9x.cpp index b6f8acef2..d1ca7bdd9 100644 --- a/src/gruvin9x.cpp +++ b/src/gruvin9x.cpp @@ -480,7 +480,11 @@ inline uint8_t keyDown() void clearKeyEvents() { - while(keyDown()); // loop until all keys are up +#ifdef SIMU + while (keyDown() && main_thread_running); +#else + while (keyDown()); // loop until all keys are up +#endif putEvent(0); } @@ -512,7 +516,9 @@ void doSplash() uint16_t tgtime = get_tmr10ms() + SPLASH_TIMEOUT; //2sec splash screen while(tgtime != get_tmr10ms()) { -#ifndef SIMU +#ifdef SIMU + if (!main_thread_running) return; +#else getADC_filt(); #endif uint16_t tsum = 0; @@ -606,6 +612,10 @@ void checkSwitches() //loop until all switches are reset while (1) { +#ifdef SIMU + if (!main_thread_running) return; +#endif + uint8_t i; for(i=SW_BASE; i