[Si443x] Implement finishReceive

pull/1592/head
jgromes 2025-09-06 16:54:47 +01:00
rodzic 4581004779
commit 792dd13b7b
2 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -112,6 +112,7 @@ int16_t Si443x::receive(uint8_t* data, size_t len, RadioLibTime_t timeout) {
RadioLibTime_t start = this->mod->hal->millis(); RadioLibTime_t start = this->mod->hal->millis();
while(this->mod->hal->digitalRead(this->mod->getIrq())) { while(this->mod->hal->digitalRead(this->mod->getIrq())) {
if(this->mod->hal->millis() - start > timeoutInternal) { if(this->mod->hal->millis() - start > timeoutInternal) {
(void)finishReceive();
return(RADIOLIB_ERR_RX_TIMEOUT); return(RADIOLIB_ERR_RX_TIMEOUT);
} }
} }
@ -346,14 +347,15 @@ int16_t Si443x::readData(uint8_t* data, size_t len) {
// clear internal flag so getPacketLength can return the new packet length // clear internal flag so getPacketLength can return the new packet length
this->packetLengthQueried = false; this->packetLengthQueried = false;
// set mode to standby return(finishReceive());
int16_t state = standby(); }
RADIOLIB_ASSERT(state);
int16_t Si443x::finishReceive() {
// clear interrupt flags // clear interrupt flags
clearIrqStatus(); clearIrqStatus();
return(RADIOLIB_ERR_NONE); // set mode to standby to disable RF switch
return(standby());
} }
int16_t Si443x::setBitRate(float br) { int16_t Si443x::setBitRate(float br) {

Wyświetl plik

@ -719,6 +719,12 @@ class Si443x: 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;
// configuration methods // configuration methods
/*! /*!