Skip to content

Commit 239d7d1

Browse files
committed
an update of RadioLib
1 parent 9f2dfd7 commit 239d7d1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

software/firmware/source/libraries/RadioLib/src/modules/LR11x0/LR11x0.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ int16_t LR11x0::beginGNSS(uint8_t constellations, float tcxoVoltage) {
129129
state = this->clearErrors();
130130
RADIOLIB_ASSERT(state);
131131

132+
// set GNSS flag to reserve DIO11 for LF clock
133+
this->gnss = true;
132134
state = this->configLfClock(RADIOLIB_LR11X0_LF_BUSY_RELEASE_DISABLED | RADIOLIB_LR11X0_LF_CLK_XOSC);
133135
RADIOLIB_ASSERT(state);
134136

@@ -2066,6 +2068,7 @@ int16_t LR11x0::modSetup(float tcxoVoltage, uint8_t modem) {
20662068
this->mod->spiConfig.stream = true;
20672069
this->mod->spiConfig.parseStatusCb = SPIparseStatus;
20682070
this->mod->spiConfig.checkStatusCb = SPIcheckStatus;
2071+
this->gnss = false;
20692072

20702073
// try to find the LR11x0 chip - this will also reset the module at least once
20712074
if(!LR11x0::findChip(this->chipType)) {
@@ -2452,7 +2455,7 @@ int16_t LR11x0::setDioIrqParams(uint32_t irq1, uint32_t irq2) {
24522455
}
24532456

24542457
int16_t LR11x0::setDioIrqParams(uint32_t irq) {
2455-
return(setDioIrqParams(irq, irq));
2458+
return(setDioIrqParams(irq, this->gnss ? 0 : irq));
24562459
}
24572460

24582461
int16_t LR11x0::clearIrq(uint32_t irq) {
@@ -2463,7 +2466,7 @@ int16_t LR11x0::clearIrq(uint32_t irq) {
24632466
}
24642467

24652468
int16_t LR11x0::configLfClock(uint8_t setup) {
2466-
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_CONFIG_LF_LOCK, true, &setup, 1));
2469+
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK, true, &setup, 1));
24672470
}
24682471

24692472
int16_t LR11x0::setTcxoMode(uint8_t tune, uint32_t delay) {

software/firmware/source/libraries/RadioLib/src/modules/LR11x0/LR11x0.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#define RADIOLIB_LR11X0_CMD_SET_DIO_AS_RF_SWITCH (0x0112)
3434
#define RADIOLIB_LR11X0_CMD_SET_DIO_IRQ_PARAMS (0x0113)
3535
#define RADIOLIB_LR11X0_CMD_CLEAR_IRQ (0x0114)
36-
#define RADIOLIB_LR11X0_CMD_CONFIG_LF_LOCK (0x0116)
36+
#define RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK (0x0116)
3737
#define RADIOLIB_LR11X0_CMD_SET_TCXO_MODE (0x0117)
3838
#define RADIOLIB_LR11X0_CMD_REBOOT (0x0118)
3939
#define RADIOLIB_LR11X0_CMD_GET_VBAT (0x0119)
@@ -281,7 +281,7 @@
281281
#define RADIOLIB_LR11X0_IRQ_ALL (0x1BF80FFCUL) // 31 0 all interrupts
282282
#define RADIOLIB_LR11X0_IRQ_NONE (0x00UL << 0) // 31 0 no interrupts
283283

284-
// RADIOLIB_LR11X0_CMD_CONFIG_LF_LOCK
284+
// RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK
285285
#define RADIOLIB_LR11X0_LF_CLK_RC (0x00UL << 0) // 1 0 32.768 kHz source: RC oscillator
286286
#define RADIOLIB_LR11X0_LF_CLK_XOSC (0x01UL << 0) // 1 0 crystal oscillator
287287
#define RADIOLIB_LR11X0_LF_CLK_EXT (0x02UL << 0) // 1 0 external signal on DIO11
@@ -1828,6 +1828,7 @@ class LR11x0: public PhysicalLayer {
18281828
float dataRateMeasured = 0;
18291829

18301830
uint8_t wifiScanMode = 0;
1831+
bool gnss = false;
18311832

18321833
int16_t modSetup(float tcxoVoltage, uint8_t modem);
18331834
static int16_t SPIparseStatus(uint8_t in);

0 commit comments

Comments
 (0)