[SX128x] Implement finishReceive

pull/1592/head
jgromes 2025-09-06 18:09:58 +01:00
rodzic 9ff26d9679
commit c5ce2f43b3
2 zmienionych plików z 16 dodań i 2 usunięć

Wyświetl plik

@ -393,8 +393,7 @@ int16_t SX128x::receive(uint8_t* data, size_t len, RadioLibTime_t timeout) {
// check whether this was a timeout or not // check whether this was a timeout or not
if((getIrqStatus() & RADIOLIB_SX128X_IRQ_RX_TX_TIMEOUT) || softTimeout) { if((getIrqStatus() & RADIOLIB_SX128X_IRQ_RX_TX_TIMEOUT) || softTimeout) {
standby(); (void)finishReceive();
clearIrqStatus();
return(RADIOLIB_ERR_RX_TIMEOUT); return(RADIOLIB_ERR_RX_TIMEOUT);
} }
@ -569,6 +568,15 @@ int16_t SX128x::readData(uint8_t* data, size_t len) {
return(state); return(state);
} }
int16_t SX128x::finishReceive() {
// clear interrupt flags
int16_t state = clearIrqStatus();
RADIOLIB_ASSERT(state);
// set mode to standby to disable RF switch
return(standby());
}
uint32_t SX128x::getIrqFlags() { uint32_t SX128x::getIrqFlags() {
return((uint32_t)this->getIrqStatus()); return((uint32_t)this->getIrqStatus());
} }

Wyświetl plik

@ -565,6 +565,12 @@ class SX128x: public PhysicalLayer {
*/ */
int16_t readData(uint8_t* data, size_t len) override; int16_t readData(uint8_t* data, size_t len) override;
/*!
\brief Clean up after reception is done.
\returns \ref status_codes
*/
int16_t finishReceive() override;
/*! /*!
\brief Read currently active IRQ flags. \brief Read currently active IRQ flags.
\returns IRQ flags. \returns IRQ flags.