aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2019-11-12 17:31:23 +0100
committerHarald Welte <laforge@osmocom.org>2019-11-12 17:33:44 +0100
commit977327c4298416fa9e757e2492718991f55a9068 (patch)
treeffe6dbf014d060fa4caf20ff88987179f06e10d6
parent5a89cbeff39f524f989c9cd17c4f47cbafd5f030 (diff)
Avoid endless loop while printing debug uart ringbuffer
-rw-r--r--sysmoOCTSIM/hal/src/hal_usart_async_rings.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sysmoOCTSIM/hal/src/hal_usart_async_rings.c b/sysmoOCTSIM/hal/src/hal_usart_async_rings.c
index 38bdca4..704c6ab 100644
--- a/sysmoOCTSIM/hal/src/hal_usart_async_rings.c
+++ b/sysmoOCTSIM/hal/src/hal_usart_async_rings.c
@@ -321,7 +321,11 @@ static int32_t usart_async_rings_write(struct io_descriptor *const io_descr, con
ASSERT(descr && buf && length);
for (uint16_t i = 0; i < length; i++) {
- while (ringbuffer_num(&descr->tx) > descr->tx.size); // WARNING blocking until there is space in the buffer
+ /* HACK: disabling this to avoid getting stuck indefinitely. In theory, this while loop below
+ * would exit at some point as the UART is supposedly transmitting data. However, in some
+ * situations it is not transmitting, and hence the condition becomes never true, waiting here
+ * indefinitely. We will now simply ovewrite old log data if it isn't sent fast enough */
+ //while (ringbuffer_num(&descr->tx) > descr->tx.size); // WARNING blocking until there is space in the buffer
ringbuffer_put(&descr->tx, buf[i]);
}
descr->stat = USART_ASYNC_RINGS_STATUS_BUSY;