- Fix I2C pins in variant.h (GPIO21/22 → GPIO4/5 per datasheet)
- Fix GPS UART pins in platformio.ini (UART0 1/3 → UART1 21/19)
- Fix radio_set_tx_power signature (uint8_t → int8_t)
- Remove conflicting duplicate defines between variant.h and Board.h
(P_LORA_BUSY was RADIOLIB_NC vs 13, ADC_MULTIPLIER was 1.85 vs 5761)
- Remove stale LoRa/WisBlock defines from variant.h (Board.h is
authoritative)
- Remove "ethernet" and "can" from board JSON connectivity
- Use static SPIClass for radio init (matches Heltec V3 convention)
- Remove build_unflags=-Os (keep size optimization for 4MB flash)
Verified against RAK11200/RAK13300 datasheets
Compile fails due to user_btn not declared in board target.
Fixes:
- Add MomentaryButton declaration for user_btn in variants/xiao_nrf52/target.cpp
- Add momentary button helper include in variants/xiao_nrf52/target.h
- Add extern linkage for MomentaryButton -> user_btn in variants/xiao_nrf52/target.h
SerialEthernetInterface.cpp is compiled for every nRF52 target because
PlatformIO builds all .cpp files under src/. It includes
SerialEthernetInterface.h, which unconditionally pulls in
<RAK13800_W5100S.h> -- a library only present in the RAK4631 Ethernet
env's lib_deps. As a result any other nRF52 board (e.g. Heltec T114)
fails to build with 'RAK13800_W5100S.h: No such file or directory'.
Wrap the contents of both files in '#ifdef ETHERNET_ENABLED' so they
compile to empty translation units on non-Ethernet builds. RAK4631
Ethernet envs define ETHERNET_ENABLED and are unaffected.
Fixes#2985
Improvements:
- Add condition to only turn off display if on (avoids wedging the shutdown on some displays)
- Reset LoRa radio before calling radio_driver.powerOff() to ensure it is in a known good state (and will accept the command)
- Ensure SPI is started so LoRa radio commands can be sent (some shutdowns can happen before this)
- Add gate for P_LORA_NSS pin defined before writing to the pin