feat: Stuck key test for COLORLCD (#1289)
* Stuck key test for COLORLCD #1271 * always start with the first button, no matter what this button is. * Add LED error * Move LED_ERROR_END to ensure runs after dlg close Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
+29
-1
@@ -726,7 +726,35 @@ void checkAll()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
#warning "KEYSTUCK Message Not Yet Implemented"
|
if (!waitKeysReleased()) {
|
||||||
|
auto dlg = new FullScreenDialog(WARNING_TYPE_ALERT, STR_KEYSTUCK);
|
||||||
|
LED_ERROR_BEGIN();
|
||||||
|
AUDIO_ERROR_MESSAGE(AU_ERROR);
|
||||||
|
tmr10ms_t tgtime = get_tmr10ms() + 500;
|
||||||
|
uint32_t keys = readKeys();
|
||||||
|
std::string strKeys("");
|
||||||
|
const char STR_VKEYS[] = TR_VKEYS;
|
||||||
|
const int len = int(LEN_VKEYS[0]);
|
||||||
|
char s[6];
|
||||||
|
s[5] = 0;
|
||||||
|
for (int i = 0; i < (int)TRM_BASE; i++) {
|
||||||
|
if (keys & (1 << i)) {
|
||||||
|
strncpy(s, &STR_VKEYS[i * len], len);
|
||||||
|
strKeys += s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dlg->setMessage(strKeys.c_str());
|
||||||
|
dlg->setCloseCondition([tgtime]() {
|
||||||
|
if (tgtime >= get_tmr10ms() && keyDown()) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dlg->runForever();
|
||||||
|
LED_ERROR_END();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (!waitKeysReleased()) {
|
if (!waitKeysReleased()) {
|
||||||
showMessageBox(STR_KEYSTUCK);
|
showMessageBox(STR_KEYSTUCK);
|
||||||
|
|||||||
Reference in New Issue
Block a user