From dc7469c64ba81486540a6f8b5e2458d4df6e4a4f Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 13 Jun 2020 08:28:01 -0700 Subject: [PATCH] useful bluetooth debugging output --- src/esp32/main-esp32.cpp | 5 +++++ src/main.cpp | 2 ++ src/mesh/PhoneAPI.cpp | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/esp32/main-esp32.cpp b/src/esp32/main-esp32.cpp index 67256bc7..2b4711d5 100644 --- a/src/esp32/main-esp32.cpp +++ b/src/esp32/main-esp32.cpp @@ -160,6 +160,11 @@ void esp32Setup() DEBUG_MSG("Setting random seed %u\n", seed); randomSeed(seed); // ESP docs say this is fairly random + DEBUG_MSG("Total heap: %d\n", ESP.getHeapSize()); + DEBUG_MSG("Free heap: %d\n", ESP.getFreeHeap()); + DEBUG_MSG("Total PSRAM: %d\n", ESP.getPsramSize()); + DEBUG_MSG("Free PSRAM: %d\n", ESP.getFreePsram()); + #ifdef AXP192_SLAVE_ADDRESS axp192Init(); #endif diff --git a/src/main.cpp b/src/main.cpp index 0c9fe5ca..ded027f5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -283,6 +283,8 @@ void loop() DEBUG_PORT.loop(); // Send/receive protobufs over the serial port #endif + // heap_caps_check_integrity_all(true); // FIXME - disable this expensive check + #ifndef NO_ESP32 esp32Loop(); #endif diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index b4c5538c..ce8b13d2 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -91,8 +91,12 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) */ size_t PhoneAPI::getFromRadio(uint8_t *buf) { - if (!available()) + if (!available()) { + DEBUG_MSG("getFromRadio, !available\n"); return false; + } else { + DEBUG_MSG("getFromRadio, state=%d\n", state); + } // In case we send a FromRadio packet memset(&fromRadioScratch, 0, sizeof(fromRadioScratch));