mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-08-29 01:08:59 +00:00
console mode: bring up the input hardware ourselves
Keys did nothing on the T-Deck because nothing was scanning them. The touch and keyboard poll task is started inside UITask::loop(), below the console early return AND behind 'if (!g_lv.ready) return;' — and g_lv.ready is false in console mode, since that is the LVGL flag and LVGL is never initialised. So tdeckKeyboardBegin() was never called and the ring the drain reads was always empty. Console mode now starts it once itself. One call covers both: the background poll task owns the shared I2C bus and scans the touch panel and, on the T-Deck, the keyboard. Which is exactly why it must not be polled from two places. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b73965c18f
commit
7d98d359ee
+19
-1
@@ -51977,8 +51977,26 @@ void UITask::loop() {
|
||||
unsigned long now = millis();
|
||||
#if CAP_CONSOLE
|
||||
if (s_console_mode) {
|
||||
#if CAP_TOUCH
|
||||
// Bring up the input hardware ourselves. The graphical path does this far
|
||||
// below, behind `if (!g_lv.ready) return;` — and g_lv.ready is false here
|
||||
// because LVGL is never initialised, so nothing ever started the poll task
|
||||
// and the keyboard was never even begun. That is why keys did nothing.
|
||||
//
|
||||
// One call covers both: the background poll task owns the shared I2C bus
|
||||
// and scans the touch panel AND (on the T-Deck) the keyboard, which is
|
||||
// exactly why they must not be polled from two places at once.
|
||||
static bool s_con_input_up = false;
|
||||
if (!s_con_input_up) {
|
||||
if (heltecV4CapTouchBegin()) {
|
||||
heltecV4CapTouchStartBackgroundPoll(8);
|
||||
s_con_input_up = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// The physical-keyboard drain lives further down this function, below this
|
||||
// return, so console mode has to do its own. Same source, same buffer.
|
||||
// return, so console mode has to do its own. Same ring, filled by the task
|
||||
// started above.
|
||||
#if defined(HAS_TDECK_KEYBOARD)
|
||||
for (int kbi = 0; kbi < 12; ++kbi) {
|
||||
int key = tdeckKeyboardReadKey();
|
||||
|
||||
Reference in New Issue
Block a user