* bug fix for rxdelay 0
This commit is contained in:
@@ -197,6 +197,7 @@ protected:
|
||||
}
|
||||
|
||||
int calcRxDelay(float score, uint32_t air_time) const override {
|
||||
if (_prefs.rx_delay_base <= 0.0f) return 0;
|
||||
return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time);
|
||||
}
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ protected:
|
||||
}
|
||||
|
||||
int calcRxDelay(float score, uint32_t air_time) const override {
|
||||
if (_prefs.rx_delay_base <= 0.0f) return 0;
|
||||
return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
namespace mesh {
|
||||
|
||||
#define MAX_RX_DELAY_MILLIS 32000 // 32 seconds
|
||||
|
||||
void Dispatcher::begin() {
|
||||
n_sent_flood = n_sent_direct = 0;
|
||||
n_recv_flood = n_recv_direct = 0;
|
||||
@@ -127,6 +129,9 @@ void Dispatcher::checkRecv() {
|
||||
processRecvPacket(pkt); // is below the score delay threshold, so process immediately
|
||||
} else {
|
||||
MESH_DEBUG_PRINTLN("Dispatcher::checkRecv(), score delay is: %d millis", _delay);
|
||||
if (_delay > MAX_RX_DELAY_MILLIS) {
|
||||
_delay = MAX_RX_DELAY_MILLIS;
|
||||
}
|
||||
_mgr->queueInbound(pkt, futureMillis(_delay)); // add to delayed inbound queue
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user