Improved sbus handling with a possibility to abandon stuck SBUS frames
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#include "Arduino.h"
|
||||
#include "tx_input.h"
|
||||
|
||||
enum sbusProtocolStates {
|
||||
SBUS_DECODING_STATE_IDLE,
|
||||
SBUS_DECODING_STATE_IN_PROGRESS
|
||||
};
|
||||
|
||||
class SbusInput : public TxInput
|
||||
{
|
||||
@@ -14,9 +18,12 @@ class SbusInput : public TxInput
|
||||
void restart(void);
|
||||
void loop(void);
|
||||
bool isReceiving(void);
|
||||
void recoverStuckFrames(void);
|
||||
private:
|
||||
HardwareSerial &_serial;
|
||||
uint32_t _lastChannelReceivedAt = 0;
|
||||
uint32_t _frameDecodingStartedAt = 0;
|
||||
uint32_t _frameDecodingEndedAt = 0 ;
|
||||
uint8_t _protocolState = SBUS_DECODING_STATE_IDLE;
|
||||
void sbusRead(void);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user