From 32db2f2bf57eaeb4c9f805bcc7d6698623580747 Mon Sep 17 00:00:00 2001 From: GlassOnTin Date: Sun, 29 Mar 2026 13:03:09 +0100 Subject: [PATCH] Guard profiling for T-Watch only, fix T-Beam Supreme build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Profiling variables (prof_radio_us etc.) are defined in Gui.h which is T-Watch only. Wrapped all profiling lines in the main loop with #if BOARD_MODEL == BOARD_TWATCH_ULT guards so other board targets (T-Beam Supreme, Heltec, etc.) compile cleanly. Beacon RF link verified: T-Beam Supreme receiver detects watch beacon transmissions at -74 dBm (same Pi, cm apart). Airtime shows 1.33% during beacon TX. However, Reticulum rejects the packets due to IFAC signature mismatch — the watch's IfacAuth.h Ed25519/HKDF implementation produces different signatures than Reticulum's Python crypto. Needs investigation in the IFAC apply/verify path. --- RNode_Firmware.ino | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index d2d0f3e..95a5d49 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -1962,9 +1962,10 @@ void tx_queue_handler() { void work_while_waiting() { loop(); } void loop() { - uint32_t _prof_t0, _prof_t1; + #if BOARD_MODEL == BOARD_TWATCH_ULT + uint32_t _prof_t0 = micros(), _prof_t1; + #endif - _prof_t0 = micros(); if (radio_online) { // Process deferred RX interrupt from main context // (avoids SPI bus contention from ISR) @@ -2035,7 +2036,9 @@ void loop() { } } + #if BOARD_MODEL == BOARD_TWATCH_ULT _prof_t1 = micros(); prof_radio_us = _prof_t1 - _prof_t0; _prof_t0 = _prof_t1; + #endif #if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52 buffer_serial(); @@ -2050,19 +2053,25 @@ void loop() { if (!fifo_isempty_locked(&channelFIFO[CHANNEL_USB])) serial_poll(); #endif + #if BOARD_MODEL == BOARD_TWATCH_ULT _prof_t1 = micros(); prof_serial_us = _prof_t1 - _prof_t0; _prof_t0 = _prof_t1; + #endif #if HAS_DISPLAY if (disp_ready && !display_updating) update_display(); #endif + #if BOARD_MODEL == BOARD_TWATCH_ULT _prof_t1 = micros(); prof_display_us = _prof_t1 - _prof_t0; _prof_t0 = _prof_t1; + #endif #if HAS_PMU if (pmu_ready) update_pmu(); #endif + #if BOARD_MODEL == BOARD_TWATCH_ULT _prof_t1 = micros(); prof_pmu_us = _prof_t1 - _prof_t0; _prof_t0 = _prof_t1; + #endif #if HAS_GPS == true if (gps_ready) { @@ -2085,7 +2094,9 @@ void loop() { } #endif + #if BOARD_MODEL == BOARD_TWATCH_ULT _prof_t1 = micros(); prof_gps_us = _prof_t1 - _prof_t0; _prof_t0 = _prof_t1; + #endif #if HAS_RTC == true static uint32_t rtc_last_read = 0; @@ -2099,7 +2110,9 @@ void loop() { if (!console_active && bt_ready) update_bt(); #endif + #if BOARD_MODEL == BOARD_TWATCH_ULT _prof_t1 = micros(); prof_bt_us = _prof_t1 - _prof_t0; _prof_t0 = _prof_t1; + #endif #if HAS_WIFI if (wifi_initialized) update_wifi(); @@ -2204,7 +2217,9 @@ void loop() { } #endif + #if BOARD_MODEL == BOARD_TWATCH_ULT _prof_t1 = micros(); prof_imu_us = _prof_t1 - _prof_t0; + #endif if (memory_low) { #if PLATFORM == PLATFORM_ESP32