| 289 | bool wait_for_user; // = false |
| 290 | |
| 291 | void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) { |
| 292 | UNUSED(no_sleep); |
| 293 | KEEPALIVE_STATE(PAUSED_FOR_USER); |
| 294 | wait_for_user = true; |
| 295 | if (ms) ms += millis(); // expire time |
| 296 | while (wait_for_user && !(ms && ELAPSED(millis(), ms))) |
| 297 | idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep)); |
| 298 | wait_for_user = false; |
| 299 | while (ui.button_pressed()) safe_delay(50); |
| 300 | } |
| 301 | |
| 302 | #endif |
| 303 |
no test coverage detected