Skip to content

Commit e20f19e

Browse files
Change PABOOST defintion
1 parent bba8932 commit e20f19e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/lora/LoRa.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
#define MODE_RX_SINGLE 0x06
4141

4242
// PA config
43-
#define PA_BOOST 0x80
44-
#define RFO 0x70
43+
//#define PA_BOOST 0x80
44+
//#define RFO 0x70
4545
// IRQ masks
4646
#define IRQ_TX_DONE_MASK 0x08
4747
#define IRQ_PAYLOAD_CRC_ERROR_MASK 0x20
@@ -93,10 +93,11 @@ int LoRaClass::begin(long frequency,bool PABOOST)
9393
writeRegister(REG_LNA, readRegister(REG_LNA) | 0x03);
9494
// set auto AGC
9595
writeRegister(REG_MODEM_CONFIG_3, 0x04);
96-
// set output power to 20 dBm
97-
setTxPower(14, PA_OUTPUT_PA_BOOST_PIN);
98-
//setTxPowerMax(14); //PA_BOOST
99-
// set Spreading Factor to 7 (6~12)
96+
// set output power to 14 dBm
97+
if(PABOOST == true)
98+
setTxPower(14, RF_PACONFIG_PASELECT_PABOOST);
99+
else
100+
setTxPower(14, RF_PACONFIG_PASELECT_RFO);
100101
setSpreadingFactor(11);
101102
// put in standby mode
102103
setSignalBandwidth(125E3);
@@ -350,7 +351,7 @@ void LoRaClass::setTxPowerMax(int level)
350351
}
351352
writeRegister(REG_LR_OCP,0x3f);
352353
writeRegister(REG_PaDac,0x87);//Open PA_BOOST
353-
writeRegister(REG_PA_CONFIG, PA_BOOST | (level - 5));
354+
writeRegister(REG_PA_CONFIG, RF_PACONFIG_PASELECT_PABOOST | (level - 5));
354355
}
355356

356357
void LoRaClass::setFrequency(long frequency)

0 commit comments

Comments
 (0)