rx_boost state is undefined at boot (minor fix)

every LBT-retried flood packet loses its priority (fixed)
witching between LBT and non-LBT mode (or any cad.mode change) could silently skip full reconfiguration and leave the radio in the wrong mode (fixed)
This commit is contained in:
liquidraver
2026-05-08 09:50:52 +02:00
parent 66f7b8508f
commit 6919c3511c
5 changed files with 36 additions and 3 deletions
+16
View File
@@ -96,6 +96,17 @@ struct PacketQueue {
return (i < _num) ? _schedule_table[i] : 0;
}
/* Priority of the next packet that get(now) would return, without
* removing it. Returns 0xFF if no due packet exists. */
uint8_t peekPriority(uint32_t now) const {
uint8_t best = 0xFF;
for (int j = 0; j < _num; j++) {
if ((int32_t)(_schedule_table[j] - now) > 0) continue;
if (_pri_table[j] < best) best = _pri_table[j];
}
return best;
}
bool reschedule(int i, uint32_t new_scheduled_for) {
if (i >= _num) return false;
_schedule_table[i] = new_scheduled_for;
@@ -193,6 +204,11 @@ bool StaticPoolPacketManager::rescheduleOutbound(int i, uint32_t new_scheduled_f
return _send_queue.reschedule(i, new_scheduled_for);
}
uint8_t StaticPoolPacketManager::peekNextOutboundPriority(uint32_t now) const
{
return _send_queue.peekPriority(now);
}
void StaticPoolPacketManager::queueInbound(Packet *packet, uint32_t scheduled_for)
{
if (!_rx_queue.add(packet, 0, scheduled_for)) {