Guard profiling for T-Watch only, fix T-Beam Supreme build

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.
This commit is contained in:
GlassOnTin 2026-03-29 13:03:09 +01:00
commit 32db2f2bf5

View file

@ -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