Access getIrqStatus() without Godmode and change the flag setting like SX126x handles it.

pull/632/head
Thomas Göttgens 2022-12-05 11:17:59 +01:00
rodzic aa8330cf57
commit 08de95e15e
2 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -529,7 +529,12 @@ int16_t SX128x::startReceive(uint16_t timeout) {
}
// set DIO mapping
int16_t state = setDioIrqParams(RADIOLIB_SX128X_IRQ_RX_DONE | RADIOLIB_SX128X_IRQ_RX_TX_TIMEOUT | RADIOLIB_SX128X_IRQ_CRC_ERROR | RADIOLIB_SX128X_IRQ_HEADER_ERROR, RADIOLIB_SX128X_IRQ_RX_DONE);
uint16_t mask = RADIOLIB_SX128X_IRQ_RX_DONE;
if(timeout != RADIOLIB_SX128X_RX_TIMEOUT_INF)
mask |= RADIOLIB_SX128X_IRQ_RX_TX_TIMEOUT;
int16_t state = setDioIrqParams(RADIOLIB_SX128X_IRQ_RX_DONE | RADIOLIB_SX128X_IRQ_RX_TX_TIMEOUT | RADIOLIB_SX128X_IRQ_CRC_ERROR | RADIOLIB_SX128X_IRQ_HEADER_ERROR, mask);
RADIOLIB_ASSERT(state);
// set buffer pointers

Wyświetl plik

@ -564,11 +564,18 @@ class SX128x: public PhysicalLayer {
\brief Interrupt-driven receive method. DIO1 will be activated when full packet is received.
\param timeout Raw timeout value, expressed as multiples of 15.625 us. Defaults to RADIOLIB_SX128X_RX_TIMEOUT_INF for infinite timeout (Rx continuous mode), set to RADIOLIB_SX128X_RX_TIMEOUT_NONE for no timeout (Rx single mode).
If timeout other than infinite is set, signal will be generated on DIO1.
\returns \ref status_codes
*/
int16_t startReceive(uint16_t timeout = RADIOLIB_SX128X_RX_TIMEOUT_INF);
/*!
\brief Reads the current IRQ status.
\returns IRQ status bits
*/
uint16_t getIrqStatus();
/*!
\brief Reads data received after calling startReceive method.
@ -874,7 +881,6 @@ class SX128x: public PhysicalLayer {
int16_t setPacketParamsBLE(uint8_t connState, uint8_t crcLen, uint8_t bleTestPayload, uint8_t whitening);
int16_t setPacketParamsLoRa(uint8_t preambleLen, uint8_t headerType, uint8_t payloadLen, uint8_t crc, uint8_t invertIQ = RADIOLIB_SX128X_LORA_IQ_STANDARD);
int16_t setDioIrqParams(uint16_t irqMask, uint16_t dio1Mask, uint16_t dio2Mask = RADIOLIB_SX128X_IRQ_NONE, uint16_t dio3Mask = RADIOLIB_SX128X_IRQ_NONE);
uint16_t getIrqStatus();
int16_t clearIrqStatus(uint16_t clearIrqParams = RADIOLIB_SX128X_IRQ_ALL);
int16_t setRangingRole(uint8_t role);
int16_t setPacketType(uint8_t type);