refactor: make cel_serial_read non-blocking

Drop timeout_ms; read now returns immediately with whatever
data is available (0 if none), so callers don't block the rest
of their loop waiting on serial I/O.

telemetry's poll loop now sleeps interval_ms itself between
empty reads via a small sleep_ms helper.
This commit is contained in:
2026-06-14 20:29:47 +02:00
parent 5324f6e36e
commit a1ea02771c
4 changed files with 26 additions and 8 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ void test_read_returns_zero_stub(void) {
TEST_ASSERT_NOT_NULL(port);
uint8_t buf[16];
/* Stub implementation returns 0 */
size_t n = cel_serial_read(port, buf, sizeof(buf), 100);
size_t n = cel_serial_read(port, buf, sizeof(buf));
TEST_ASSERT_EQUAL_UINT(0, n);
cel_serial_close(port);
}