From 2982e197e092587f436520e8f43771dc0f1f85d9 Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 29 Apr 2020 19:04:59 -0700 Subject: [PATCH] radio settings now work on real sx1262 hw --- platformio.ini | 1 + src/rf95/SX1262Interface.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/platformio.ini b/platformio.ini index d570b1190..4f39e7904 100644 --- a/platformio.ini +++ b/platformio.ini @@ -128,6 +128,7 @@ platform = nordicnrf52 board = ppr framework = arduino debug_tool = jlink +build_type = debug ; I'm debugging with ICE a lot now build_flags = ${env.build_flags} -Wno-unused-variable -Isrc/nrf52 src_filter = diff --git a/src/rf95/SX1262Interface.cpp b/src/rf95/SX1262Interface.cpp index 73ee2e5ed..bd951c46a 100644 --- a/src/rf95/SX1262Interface.cpp +++ b/src/rf95/SX1262Interface.cpp @@ -22,6 +22,8 @@ bool SX1262Interface::init() bool useRegulatorLDO = false; // Seems to depend on the connection to pin 9/DCC_SW - if an inductor DCDC? applyModemConfig(); + if (power > 22) // This chip has lower power limits than some + power = 22; int res = lora.begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength, tcxoVoltage, useRegulatorLDO); DEBUG_MSG("LORA init result %d\n", res); @@ -58,6 +60,8 @@ bool SX1262Interface::reconfigure() err = lora.setFrequency(freq); assert(err == ERR_NONE); + if (power > 22) // This chip has lower power limits than some + power = 22; err = lora.setOutputPower(power); assert(err == ERR_NONE);