PPR1 and allow boards to set lower or higher sx1262 power limits

This commit is contained in:
Kevin Hester
2020-10-15 13:47:10 +08:00
parent 152ebf0dff
commit 5f2f3c94b9
8 changed files with 295 additions and 8 deletions

View File

@@ -1,6 +1,11 @@
#include "SX1262Interface.h"
#include <configuration.h>
// Particular boards might define a different max power based on what their hardware can do
#ifndef SX1262_MAX_POWER
#define SX1262_MAX_POWER 22
#endif
SX1262Interface::SX1262Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
SPIClass &spi)
: RadioLibInterface(cs, irq, rst, busy, spi, &lora), lora(&module)
@@ -39,10 +44,10 @@ bool SX1262Interface::init()
applyModemConfig();
if (power == 0)
power = 22;
power = SX1262_MAX_POWER;
if (power > 22) // This chip has lower power limits than some
power = 22;
if (power > SX1262_MAX_POWER) // This chip has lower power limits than some
power = SX1262_MAX_POWER;
limitPower();