Boot stub: periodic heap status and key logging on serial

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-02 09:05:06 +02:00
co-authored by Claude Opus 5.5
parent fd4afd54da
commit 4c0be8925d
+15 -2
View File
@@ -19,11 +19,21 @@ void setup() {
d.drawString("Press keys...", 8, 56);
Serial.begin(115200);
Serial.printf("%s %s, free heap %u, psram %u\n", roro::kProductName,
roro::versionString(), ESP.getFreeHeap(), ESP.getPsramSize());
}
static void printStatus() {
Serial.printf("%s %s, free heap %u, min free heap %u, psram %u\n", roro::kProductName,
roro::versionString(), ESP.getFreeHeap(), ESP.getMinFreeHeap(),
ESP.getPsramSize());
}
void loop() {
static uint32_t lastStatus = 0;
if (millis() - lastStatus > 3000) {
lastStatus = millis();
printStatus();
}
M5Cardputer.update();
if (M5Cardputer.Keyboard.isChange() && M5Cardputer.Keyboard.isPressed()) {
auto state = M5Cardputer.Keyboard.keysState();
@@ -32,5 +42,8 @@ void loop() {
auto& d = M5Cardputer.Display;
d.fillRect(0, 80, d.width(), 20, TFT_BLACK);
d.drawString("key: " + s, 8, 80);
Serial.printf("keys: word='%s' fn=%d opt=%d ctrl=%d alt=%d shift=%d enter=%d del=%d tab=%d\n",
s.c_str(), state.fn, state.opt, state.ctrl, state.alt, state.shift,
state.enter, state.del, state.tab);
}
}