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
|
||||
if((getIrqStatus() & RADIOLIB_SX128X_IRQ_RX_TX_TIMEOUT) || softTimeout) {
|
||||
standby();
|
||||
clearIrqStatus();
|
||||
(void)finishReceive();
|
||||
return(RADIOLIB_ERR_RX_TIMEOUT);
|
||||
}
|
||||
|
||||
|
@ -569,6 +568,15 @@ int16_t SX128x::readData(uint8_t* data, size_t len) {
|
|||
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() {
|
||||
return((uint32_t)this->getIrqStatus());
|
||||
}
|
||||
|
|
|
@ -564,6 +564,12 @@ class SX128x: public PhysicalLayer {
|
|||
\returns \ref status_codes
|
||||
*/
|
||||
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.
|
||||
|
|
Ładowanie…
Reference in New Issue