kopia lustrzana https://github.com/jgromes/RadioLib
[SX128x] Implement finishReceive
rodzic
9ff26d9679
commit
c5ce2f43b3
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Ładowanie…
Reference in New Issue