From fd4792ec666d5d4e6274802224855af24bfa9a81 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 10 Oct 2026 19:21:32 +0000 Subject: [PATCH] Bench: define MESHTASTIC_STAGE_TX_PAYLOAD at file scope The macro landed inside the #elif ARCH_PORTDUINO arm of the RF-switch block, so on any board taking the LR11X0_DIO_AS_RF_SWITCH arm - the T1000-E among them - it was never defined and the two call sites would not compile. Pure move, no change in expansion. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01A8t5a5eTjHb7MtMQ88WBu4 --- src/mesh/LR11x0Interface.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index c475c9e7de..dcddac3f9d 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -38,16 +38,6 @@ static_assert(sizeof(lr11x0_switch_dio_nums) / sizeof(lr11x0_switch_dio_nums[0]) sizeof(lr11x0_switch_dio_consts) / sizeof(lr11x0_switch_dio_consts[0]), "LR11x0 switch DIO numbers and constants must describe the same slots"); -// MESHTASTIC_PRESTAGE_VIA_PHY routes the prestage payload write through RadioLib's chip-neutral -// PhysicalLayer::writeTxBuffer() (jgromes/RadioLib#1890) instead of the chip-specific call this branch -// has been using. The staged bytes are the same; what differs is the command that carries them, and on -// SX126x writeTxBuffer() also sends a buffer-base command of its own first. -#ifdef MESHTASTIC_PRESTAGE_VIA_PHY -#define MESHTASTIC_STAGE_TX_PAYLOAD(n) lora.writeTxBuffer((uint8_t *)&radioBuffer, (n)) -#else -#define MESHTASTIC_STAGE_TX_PAYLOAD(n) lora.writeBuffer8((uint8_t *)&radioBuffer, (n)) -#endif - // This part has MODE_TX_HP/MODE_GNSS/MODE_WIFI and no MODE_RX_HF. static const int32_t lr11x0_rfswitch_mode_map[RFSW_MODE_COUNT] = { LR11x0::MODE_STBY, LR11x0::MODE_RX, LR11x0::MODE_TX, LR11x0::MODE_TX_HP, @@ -64,6 +54,16 @@ static const Module::RfSwitchMode_t rfswitch_table[] = { }; #endif +// MESHTASTIC_PRESTAGE_VIA_PHY routes the prestage payload write through RadioLib's chip-neutral +// PhysicalLayer::writeTxBuffer() (jgromes/RadioLib#1890) instead of the chip-specific call this branch +// has been using. The staged bytes are the same; what differs is the command that carries them, and on +// SX126x writeTxBuffer() also sends a buffer-base command of its own first. +#ifdef MESHTASTIC_PRESTAGE_VIA_PHY +#define MESHTASTIC_STAGE_TX_PAYLOAD(n) lora.writeTxBuffer((uint8_t *)&radioBuffer, (n)) +#else +#define MESHTASTIC_STAGE_TX_PAYLOAD(n) lora.writeBuffer8((uint8_t *)&radioBuffer, (n)) +#endif + // Particular boards might define a different max power based on what their hardware can do, default to max power output if not // specified (may be dangerous if using external PA and LR11x0 power config forgotten) #if ARCH_PORTDUINO