perf: Process CRSF telemetry by frame (#4038)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
3djc
Peter Feerick
parent
eaabb2ce97
commit
c93695eeaa
@@ -56,6 +56,9 @@ struct etx_proto_driver_t {
|
||||
// Process input data byte (telemetry)
|
||||
void (*processData)(void* ctx, uint8_t data, uint8_t* buffer, uint8_t* len);
|
||||
|
||||
// Process input data byte (telemetry)
|
||||
void (*processFrame)(void* ctx, uint8_t* frame, uint8_t flen, uint8_t* buf, uint8_t* len);
|
||||
|
||||
// Some module settings may have been modified
|
||||
void (*onConfigChange)(void* ctx);
|
||||
|
||||
|
||||
@@ -53,7 +53,10 @@ typedef struct {
|
||||
struct etx_serial_callbacks_t {
|
||||
uint8_t (*on_send)(uint8_t* data);
|
||||
void (*on_receive)(uint8_t data);
|
||||
void (*on_idle)();
|
||||
|
||||
void* on_idle_ctx;
|
||||
void (*on_idle)(void* ctx);
|
||||
|
||||
void (*on_error)();
|
||||
};
|
||||
|
||||
@@ -90,7 +93,12 @@ typedef struct {
|
||||
|
||||
// Fetch a byte by its index from the end of the buffer
|
||||
int (*getLastByte)(void* ctx, uint32_t idx, uint8_t* data);
|
||||
|
||||
|
||||
// Return the number of unread bytes
|
||||
int (*getBufferedBytes)(void* ctx);
|
||||
|
||||
int (*copyRxBuffer)(void* ctx, uint8_t* buf, uint32_t len);
|
||||
|
||||
// Clear internal buffer
|
||||
void (*clearRxBuffer)(void* ctx);
|
||||
|
||||
@@ -108,7 +116,7 @@ typedef struct {
|
||||
|
||||
// Callbacks
|
||||
void (*setReceiveCb)(void* ctx, void (*on_receive)(uint8_t*, uint32_t));
|
||||
void (*setIdleCb)(void* ctx, void (*on_idle)());
|
||||
void (*setIdleCb)(void* ctx, void (*on_idle)(void*), void* param);
|
||||
void (*setBaudrateCb)(void* ctx, void (*on_set_baudrate)(uint32_t));
|
||||
|
||||
} etx_serial_driver_t;
|
||||
|
||||
Reference in New Issue
Block a user