mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2026-04-27 22:35:36 +00:00
Fixed packet buffer FIFO state mismatch on high-bitrate queue processing if raw underlying byte buffer was full
This commit is contained in:
parent
5e98407ee2
commit
8382d4a08d
1 changed files with 5 additions and 6 deletions
|
|
@ -575,7 +575,7 @@ volatile bool queue_flushing = false;
|
||||||
void flush_queue(void) {
|
void flush_queue(void) {
|
||||||
if (!queue_flushing) {
|
if (!queue_flushing) {
|
||||||
queue_flushing = true;
|
queue_flushing = true;
|
||||||
led_tx_on(); uint16_t processed = 0;
|
led_tx_on();
|
||||||
|
|
||||||
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
|
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
|
||||||
while (!fifo16_isempty(&packet_starts)) {
|
while (!fifo16_isempty(&packet_starts)) {
|
||||||
|
|
@ -592,7 +592,7 @@ void flush_queue(void) {
|
||||||
tbuf[i] = packet_queue[pos];
|
tbuf[i] = packet_queue[pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
transmit(length); processed++;
|
transmit(length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -615,8 +615,7 @@ void flush_queue(void) {
|
||||||
|
|
||||||
void pop_queue() {
|
void pop_queue() {
|
||||||
if (!queue_flushing) {
|
if (!queue_flushing) {
|
||||||
queue_flushing = true;
|
queue_flushing = true; led_tx_on();
|
||||||
led_tx_on(); uint16_t processed = 0;
|
|
||||||
|
|
||||||
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
|
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
|
||||||
if (!fifo16_isempty(&packet_starts)) {
|
if (!fifo16_isempty(&packet_starts)) {
|
||||||
|
|
@ -632,9 +631,9 @@ void pop_queue() {
|
||||||
tbuf[i] = packet_queue[pos];
|
tbuf[i] = packet_queue[pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
transmit(length); processed++;
|
transmit(length);
|
||||||
}
|
}
|
||||||
queue_height -= processed;
|
queue_height -= 1;
|
||||||
queued_bytes -= length;
|
queued_bytes -= length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue