mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 17:13:38 +00:00
fix radiolib API for 6.3.0 release
This commit is contained in:
parent
39743832ad
commit
6fa026a78b
@ -39,7 +39,7 @@ lib_deps =
|
|||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
h2zero/NimBLE-Arduino@^1.4.1
|
h2zero/NimBLE-Arduino@^1.4.1
|
||||||
jgromes/RadioLib@ 6.2.0
|
jgromes/RadioLib@^6.2.0
|
||||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
#include "RadioLibRF95.h"
|
#include "RadioLibRF95.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#define RF95_CHIP_VERSION 0x12
|
|
||||||
#define RF95_ALT_VERSION 0x11 // Supposedly some versions of the chip have id 0x11
|
|
||||||
|
|
||||||
// From datasheet but radiolib doesn't know anything about this
|
// From datasheet but radiolib doesn't know anything about this
|
||||||
#define SX127X_REG_TCXO 0x4B
|
#define SX127X_REG_TCXO 0x4B
|
||||||
|
|
||||||
@ -13,11 +10,8 @@ int16_t RadioLibRF95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_
|
|||||||
uint8_t gain)
|
uint8_t gain)
|
||||||
{
|
{
|
||||||
// execute common part
|
// execute common part
|
||||||
int16_t state = SX127x::begin(RF95_CHIP_VERSION, syncWord, preambleLength);
|
uint8_t rf95versions[2] = {0x12, 0x11};
|
||||||
if (state != RADIOLIB_ERR_NONE) {
|
int16_t state = SX127x::begin(rf95versions, sizeof(rf95versions), syncWord, preambleLength);
|
||||||
LOG_WARN("Initial probe for RF95 failed with %d, trying again with alternative hardware version\n", state);
|
|
||||||
state = SX127x::begin(RF95_ALT_VERSION, syncWord, preambleLength);
|
|
||||||
}
|
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// current limit was removed from module' ctor
|
// current limit was removed from module' ctor
|
||||||
|
@ -250,7 +250,7 @@ template <typename T> void SX126xInterface<T>::startReceive()
|
|||||||
// We use a 16 bit preamble so this should save some power by letting radio sit in standby mostly.
|
// We use a 16 bit preamble so this should save some power by letting radio sit in standby mostly.
|
||||||
// Furthermore, we need the PREAMBLE_DETECTED and HEADER_VALID IRQ flag to detect whether we are actively receiving
|
// Furthermore, we need the PREAMBLE_DETECTED and HEADER_VALID IRQ flag to detect whether we are actively receiving
|
||||||
int err = lora.startReceiveDutyCycleAuto(preambleLength, 8,
|
int err = lora.startReceiveDutyCycleAuto(preambleLength, 8,
|
||||||
RADIOLIB_SX126X_IRQ_RX_DEFAULT | RADIOLIB_SX126X_IRQ_RADIOLIB_PREAMBLE_DETECTED |
|
RADIOLIB_SX126X_IRQ_RX_DEFAULT | RADIOLIB_SX126X_IRQ_PREAMBLE_DETECTED |
|
||||||
RADIOLIB_SX126X_IRQ_HEADER_VALID);
|
RADIOLIB_SX126X_IRQ_HEADER_VALID);
|
||||||
assert(err == RADIOLIB_ERR_NONE);
|
assert(err == RADIOLIB_ERR_NONE);
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ template <typename T> bool SX126xInterface<T>::isActivelyReceiving()
|
|||||||
// received and handled the interrupt for reading the packet/handling errors.
|
// received and handled the interrupt for reading the packet/handling errors.
|
||||||
|
|
||||||
uint16_t irq = lora.getIrqStatus();
|
uint16_t irq = lora.getIrqStatus();
|
||||||
bool detected = (irq & (RADIOLIB_SX126X_IRQ_HEADER_VALID | RADIOLIB_SX126X_IRQ_RADIOLIB_PREAMBLE_DETECTED));
|
bool detected = (irq & (RADIOLIB_SX126X_IRQ_HEADER_VALID | RADIOLIB_SX126X_IRQ_PREAMBLE_DETECTED));
|
||||||
// Handle false detections
|
// Handle false detections
|
||||||
if (detected) {
|
if (detected) {
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
|
Loading…
Reference in New Issue
Block a user