mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-02 09:14:06 +00:00
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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user