mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 18:31:37 +00:00
limit max power on rf95 to 17 (rather than 20, because 20 can...
burn up parts if you exceed 1% duty cycle)
This commit is contained in:
parent
80268ea56a
commit
79c61cf0e0
@ -3,6 +3,9 @@
|
|||||||
#include "RadioLibRF95.h"
|
#include "RadioLibRF95.h"
|
||||||
#include <configuration.h>
|
#include <configuration.h>
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, SPIClass &spi)
|
RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, SPIClass &spi)
|
||||||
: RadioLibInterface(cs, irq, rst, 0, spi)
|
: RadioLibInterface(cs, irq, rst, 0, spi)
|
||||||
{
|
{
|
||||||
@ -17,8 +20,8 @@ bool RF95Interface::init()
|
|||||||
RadioLibInterface::init();
|
RadioLibInterface::init();
|
||||||
|
|
||||||
applyModemConfig();
|
applyModemConfig();
|
||||||
if (power > 20) // This chip has lower power limits than some
|
if (power > MAX_POWER) // This chip has lower power limits than some
|
||||||
power = 20;
|
power = MAX_POWER;
|
||||||
|
|
||||||
iface = lora = new RadioLibRF95(&module);
|
iface = lora = new RadioLibRF95(&module);
|
||||||
int res = lora->begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength);
|
int res = lora->begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength);
|
||||||
@ -67,8 +70,8 @@ bool RF95Interface::reconfigure()
|
|||||||
err = lora->setFrequency(freq);
|
err = lora->setFrequency(freq);
|
||||||
assert(err == ERR_NONE);
|
assert(err == ERR_NONE);
|
||||||
|
|
||||||
if (power > 20) // This chip has lower power limits than some
|
if (power > MAX_POWER) // This chip has lower power limits than some
|
||||||
power = 20;
|
power = MAX_POWER;
|
||||||
err = lora->setOutputPower(power);
|
err = lora->setOutputPower(power);
|
||||||
assert(err == ERR_NONE);
|
assert(err == ERR_NONE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user