feat: implement frame parse and streaming reader
cel_crsf_frame_parse() parses ELRS USB format frames: [addr][length][type][payload...][crc] cel_crsf_stream_* provides incremental parsing from a byte stream: skips invalid sync bytes, discards bad CRC frames, buffers partial frames across feed calls.
This commit is contained in:
@@ -38,6 +38,14 @@ target_compile_features(test_crsf PRIVATE c_std_23)
|
||||
add_test(NAME test_crsf COMMAND test_crsf)
|
||||
list(APPEND TEST_TARGETS test_crsf)
|
||||
|
||||
# CRSF stream tests
|
||||
add_executable(test_crsf_stream test_crsf_stream.c)
|
||||
target_include_directories(test_crsf_stream PRIVATE "${CMAKE_SOURCE_DIR}")
|
||||
target_link_libraries(test_crsf_stream PRIVATE celrs_crsf Unity::Unity)
|
||||
target_compile_features(test_crsf_stream PRIVATE c_std_23)
|
||||
add_test(NAME test_crsf_stream COMMAND test_crsf_stream)
|
||||
list(APPEND TEST_TARGETS test_crsf_stream)
|
||||
|
||||
# Serial tests — mocks the platform backend (serial_internal.h)
|
||||
add_executable(test_serial test_serial.c)
|
||||
target_include_directories(test_serial PRIVATE "${CMAKE_SOURCE_DIR}")
|
||||
|
||||
Reference in New Issue
Block a user