From 4c0be8925d334df6764f60c08a4231ca993700f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Martin?= Date: Fri, 2 Oct 2026 09:05:06 +0200 Subject: [PATCH] Boot stub: periodic heap status and key logging on serial Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT --- src/main.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fe13ec4..4865f14 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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); } }