mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-21 02:35:57 +10:00
* logging: gate LOG_TRACE behind MESHTASTIC_TRACE_LOGGING, drop redundant reclock logs LOG_TRACE now compiles out by default so trace-level diagnostics cost no flash; enable with -DMESHTASTIC_TRACE_LOGGING. Portduino keeps it on for the traceFilename packet-trace feature. Remove the 66 caller-side I2C reclock/restore log lines in the telemetry sensors: ReClockI2C::setClock/restoreClock already log both frequencies internally (now at trace level, since they fire every sensor read). Also unify near-duplicate literals (colon/case/punctuation variants) so linker string dedup applies, and drop an information-free bare 'done'. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: demote chatty per-packet/per-poll DEBUG lines to trace level With LOG_TRACE compiled out by default, per-iteration chatter (packet bookkeeping, sensor poll values, e-ink refresh reasons, GPS pin states, UI runState traces) now costs no flash on device builds while remaining one -DMESHTASTIC_TRACE_LOGGING away. 108 lines demoted, 4 information- free lines removed; failure paths, drop reasons, and one-time init logs all stay at debug level. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: address CodeRabbit review on trace-gate PR - GPS: pass serial-derived buffers as %s args, never as format strings (untrusted bytes could contain % directives) - 0x%08x for packet id / NodeNum per convention (Router, CannedMessage, NeighborInfo); unsigned casts for size_t args; %u for uint32_t delta - EInk: async full-refresh begin/complete back to DEBUG (rare state transitions); per-frame SKIPPED lines stay trace Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: gate trace on the flag's value, not its presence -DMESHTASTIC_TRACE_LOGGING=0 previously *enabled* trace logging because the gate tested definedness. The flag now defaults per-platform (portduino 1, else 0) and both backends test the value, so =0 disables, =1 or a bare -D enables. Also cast tx_after-millis() to uint32_t for %u (millis() is unsigned long on native). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * logging: clang-format rewrap after specifier widening Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * Even fewer bytes! * logging: keep compile-gated debug lines at debug level; fix native-suite-count Lines already inside default-off #ifdef blocks (GPS_DEBUG, DEBUG_LOOP_TIMING) cost no flash and should stay visible at debug level when their gate is enabled, rather than also requiring MESHTASTIC_TRACE_LOGGING. test/native-suite-count lags the two test_event_channel_* suites added by #11045 (develop's Native Suite Count check has the same mismatch); bump 46 -> 47. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 * gps: route GPS_DEBUG diagnostics through a LOG_DEBUG_GPS() macro (#11414) Replaces 27 log-only #ifdef GPS_DEBUG blocks across GPS.cpp, PositionModule, MeshService, and GPSStatus.h with a single-line LOG_DEBUG_GPS() call (src/gps/GPSLog.h, modeled on LOG_MIGRATION: value-gated, ((void)0) when off). Blocks containing declarations, control flow, hexDump, or nested conditionals keep an explicit '#if GPS_DEBUG' guard. RTC.cpp's per-reading raw time dumps and per-candidate rejection chatter fold under the same gate; quality transitions and boot-time seeding stay at debug. Also fixes the '// define GPS_DEBUG' missing-# typo in two variant headers and updates all seven commented examples to the value form ('#define GPS_DEBUG 1') required by the value-based gate. Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 Co-authored-by: Claude <noreply@anthropic.com> * gps: declare RTC gmtime result as pointer to const (cppcheck) With the setTime debug dump gated behind GPS_DEBUG, all remaining uses of t are reads; cppcheck (constVariablePointer) now flags it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LBiZc9sfPrH1MZ2L3Fxgt1 --------- Co-authored-by: Claude <noreply@anthropic.com>
104 lines
2.2 KiB
C
104 lines
2.2 KiB
C
#ifndef _VARIANT_MINIMESH_LITE_
|
|
#define _VARIANT_MINIMESH_LITE_
|
|
|
|
#define VARIANT_MCK (64000000ul)
|
|
#define USE_LFRC
|
|
|
|
#include "WVariant.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define MINIMESH_LITE
|
|
|
|
// Number of pins defined in PinDescription array
|
|
#define PINS_COUNT (48)
|
|
#define NUM_DIGITAL_PINS (48)
|
|
#define NUM_ANALOG_INPUTS (1)
|
|
#define NUM_ANALOG_OUTPUTS (0)
|
|
|
|
#define PIN_3V3_EN (0 + 13) // P0.13
|
|
|
|
// Analog pins
|
|
#define BATTERY_PIN (0 + 31) // P0.31 Battery ADC
|
|
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
|
|
#define ADC_RESOLUTION 14
|
|
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
|
#define BATTERY_SENSE_RESOLUTION 4096.0
|
|
#define VBAT_MV_PER_LSB (0.73242188F)
|
|
#define VBAT_DIVIDER (0.6F)
|
|
#define VBAT_DIVIDER_COMP (1.73)
|
|
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
|
#undef AREF_VOLTAGE
|
|
#define AREF_VOLTAGE 3.0
|
|
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
|
#define ADC_MULTIPLIER VBAT_DIVIDER_COMP
|
|
#define VBAT_RAW_TO_SCALED(x) (REAL_VBAT_MV_PER_LSB * x)
|
|
|
|
// WIRE IC AND IIC PINS
|
|
#define WIRE_INTERFACES_COUNT 1
|
|
|
|
#define PIN_WIRE_SDA (32 + 4)
|
|
#define PIN_WIRE_SCL (0 + 11)
|
|
|
|
// LED
|
|
#define PIN_LED1 (0 + 15)
|
|
// Actually red
|
|
#define LED_BLUE PIN_LED1
|
|
#define LED_STATE_ON 1
|
|
|
|
// Button
|
|
#define BUTTON_PIN (32 + 0)
|
|
|
|
// GPS
|
|
#define GPS_TX_PIN (0 + 20)
|
|
#define GPS_RX_PIN (0 + 22)
|
|
|
|
#define PIN_GPS_EN (0 + 24)
|
|
#define GPS_UBLOX
|
|
// #define GPS_DEBUG 1
|
|
|
|
// UART interfaces
|
|
#define PIN_SERIAL1_TX GPS_TX_PIN
|
|
#define PIN_SERIAL1_RX GPS_RX_PIN
|
|
|
|
#define PIN_SERIAL2_RX (0 + 6)
|
|
#define PIN_SERIAL2_TX (0 + 8)
|
|
|
|
// Serial interfaces
|
|
#define SPI_INTERFACES_COUNT 1
|
|
|
|
#define PIN_SPI_MISO (0 + 2)
|
|
#define PIN_SPI_MOSI (32 + 15)
|
|
#define PIN_SPI_SCK (32 + 11)
|
|
|
|
#define LORA_MISO PIN_SPI_MISO
|
|
#define LORA_MOSI PIN_SPI_MOSI
|
|
#define LORA_SCK PIN_SPI_SCK
|
|
#define LORA_CS (32 + 13)
|
|
|
|
// LORA MODULES
|
|
#define USE_LLCC68
|
|
#define USE_SX1262
|
|
#define USE_SX1268
|
|
|
|
// SX126X CONFIG
|
|
#define SX126X_CS (32 + 13)
|
|
#define SX126X_DIO1 (0 + 10)
|
|
#define SX126X_DIO2_AS_RF_SWITCH
|
|
|
|
#define SX126X_BUSY (0 + 29)
|
|
#define SX126X_RESET (0 + 9)
|
|
#define SX126X_RXEN (0 + 17)
|
|
#define SX126X_TXEN RADIOLIB_NC
|
|
|
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
|
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // _VARIANT_MINIMESH_LITE_
|