Fixed packet buffer FIFO state mismatch on high-bitrate queue processing if raw underlying byte buffer was full
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user