mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
Merge remote-tracking branch 'origin/havyan/OP-1473_sbus_eof' into next
This commit is contained in:
commit
ebfdaf28b5
@ -250,7 +250,7 @@ static void PIOS_SBus_UpdateState(struct pios_sbus_state *state, uint8_t b)
|
||||
state->received_data[state->byte_count - 1] = b;
|
||||
state->byte_count++;
|
||||
} else {
|
||||
if (b == SBUS_EOF_BYTE || (b % SBUS_R7008SB_EOF_COUNTER_MASK) == SBUS_R7008SB_EOF_BYTE) {
|
||||
if (b == SBUS_EOF_BYTE || (b & SBUS_R7008SB_EOF_COUNTER_MASK) == 0) {
|
||||
/* full frame received */
|
||||
uint8_t flags = state->received_data[SBUS_FRAME_LENGTH - 3];
|
||||
if (flags & SBUS_FLAG_FL) {
|
||||
|
@ -66,8 +66,7 @@
|
||||
#define SBUS_FLAG_FL 0x04
|
||||
#define SBUS_FLAG_FS 0x08
|
||||
|
||||
#define SBUS_R7008SB_EOF_COUNTER_MASK 0xCF
|
||||
#define SBUS_R7008SB_EOF_BYTE 0x04
|
||||
#define SBUS_R7008SB_EOF_COUNTER_MASK 0xCB
|
||||
|
||||
/*
|
||||
* S.Bus protocol provides 16 proportional and 2 discrete channels.
|
||||
|
Loading…
x
Reference in New Issue
Block a user