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:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user