make default power level radio chipset specific

This commit is contained in:
geeksville
2020-09-15 17:55:33 -07:00
parent 313cee9a3f
commit 31fc8fafec
3 changed files with 10 additions and 4 deletions

View File

@@ -6,6 +6,8 @@
#define MAX_POWER 17
// if we use 20 we are limited to 1% duty cycle or hw might overheat. For continuous operation set a limit of 17
#define POWER_DEFAULT 17 // How much power to use if the user hasn't set a power level
RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, SPIClass &spi)
: RadioLibInterface(cs, irq, rst, 0, spi)
{
@@ -32,6 +34,10 @@ bool RF95Interface::init()
RadioLibInterface::init();
applyModemConfig();
if (power == 0)
power = POWER_DEFAULT;
if (power > MAX_POWER) // This chip has lower power limits than some
power = MAX_POWER;