mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 06:32:06 +00:00
Radiolib API Changes
This commit is contained in:
parent
d83f8edd54
commit
6fc4a1754b
@ -25,7 +25,7 @@ template <class T> class LR11x0Interface : public RadioLibInterface
|
|||||||
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
||||||
virtual bool sleep() override;
|
virtual bool sleep() override;
|
||||||
|
|
||||||
bool isIRQPending() override { return lora.getIrqStatus() != 0; }
|
bool isIRQPending() override { return lora.getIrqFlags() != 0; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
#define SX126X_MAX_POWER 22
|
#define SX126X_MAX_POWER 22
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define RADIOLIB_SX126X_IRQ_RX_DEFAULT \
|
||||||
|
RADIOLIB_SX126X_IRQ_RX_DONE | RADIOLIB_SX126X_IRQ_TIMEOUT | RADIOLIB_SX126X_IRQ_CRC_ERR | RADIOLIB_SX126X_IRQ_HEADER_ERR
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
SX126xInterface<T>::SX126xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
SX126xInterface<T>::SX126xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
RADIOLIB_PIN_TYPE busy)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
@ -301,7 +304,7 @@ template <typename T> bool SX126xInterface<T>::isActivelyReceiving()
|
|||||||
// The IRQ status will be cleared when we start our read operation. Check if we've started a header, but haven't yet
|
// The IRQ status will be cleared when we start our read operation. Check if we've started a header, but haven't yet
|
||||||
// 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.getIrqFlags();
|
||||||
bool detected = (irq & (RADIOLIB_SX126X_IRQ_HEADER_VALID | RADIOLIB_SX126X_IRQ_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) {
|
||||||
|
@ -25,7 +25,7 @@ template <class T> class SX126xInterface : public RadioLibInterface
|
|||||||
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
||||||
virtual bool sleep() override;
|
virtual bool sleep() override;
|
||||||
|
|
||||||
bool isIRQPending() override { return lora.getIrqStatus() != 0; }
|
bool isIRQPending() override { return lora.getIrqFlags() != 0; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float currentLimit = 140; // Higher OCP limit for SX126x PA
|
float currentLimit = 140; // Higher OCP limit for SX126x PA
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
#define SX128X_MAX_POWER 13
|
#define SX128X_MAX_POWER 13
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define RADIOLIB_SX128X_IRQ_RX_DEFAULT \
|
||||||
|
RADIOLIB_SX128X_IRQ_RX_DONE | RADIOLIB_SX128X_IRQ_RX_TX_TIMEOUT | RADIOLIB_SX128X_IRQ_CRC_ERROR | \
|
||||||
|
RADIOLIB_SX128X_IRQ_HEADER_ERROR
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
SX128xInterface<T>::SX128xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
SX128xInterface<T>::SX128xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
RADIOLIB_PIN_TYPE busy)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
|
@ -27,7 +27,7 @@ template <class T> class SX128xInterface : public RadioLibInterface
|
|||||||
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
||||||
virtual bool sleep() override;
|
virtual bool sleep() override;
|
||||||
|
|
||||||
bool isIRQPending() override { return lora.getIrqStatus() != 0; }
|
bool isIRQPending() override { return lora.getIrqFlags() != 0; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user