Make fifo8 resizing code more reliable

This commit is contained in:
Cacodemon345
2024-03-11 02:02:49 +06:00
committed by GitHub
parent bc6b659e02
commit 8fd35fccb8

View File

@@ -866,7 +866,7 @@ modem_rx(void *priv, uint8_t *buf, int io_len)
return 0;
}
if ((io_len) >= (fifo8_num_free(&modem->rx_data))) {
if ((io_len) >= (fifo8_num_free(&modem->rx_data) / 2)) {
fifo8_resize_2x(&modem->rx_data);
}