mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 09:45:37 +03:00
reset sync byte in init to allow unittests to start fresh
This commit is contained in:
parent
030d2dfeb7
commit
0dd758cdec
1 changed files with 4 additions and 2 deletions
|
@ -53,7 +53,7 @@
|
||||||
#define IBUS_BAUDRATE 115200
|
#define IBUS_BAUDRATE 115200
|
||||||
|
|
||||||
static uint8_t ibusModel;
|
static uint8_t ibusModel;
|
||||||
static uint8_t ibusSyncByte = 0;
|
static uint8_t ibusSyncByte;
|
||||||
static uint8_t ibusFrameSize;
|
static uint8_t ibusFrameSize;
|
||||||
static uint8_t ibusChannelOffset;
|
static uint8_t ibusChannelOffset;
|
||||||
static uint16_t ibusChecksum;
|
static uint16_t ibusChecksum;
|
||||||
|
@ -92,8 +92,9 @@ static void ibusDataReceive(uint16_t c)
|
||||||
ibusFrameSize = 32;
|
ibusFrameSize = 32;
|
||||||
ibusChannelOffset = 2;
|
ibusChannelOffset = 2;
|
||||||
ibusChecksum = 0xFFFF;
|
ibusChecksum = 0xFFFF;
|
||||||
} else
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
} else if (ibusSyncByte != c) {
|
} else if (ibusSyncByte != c) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -149,6 +150,7 @@ static uint16_t ibusReadRawRC(const rxRuntimeConfig_t *rxRuntimeConfig, uint8_t
|
||||||
bool ibusInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig)
|
bool ibusInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig)
|
||||||
{
|
{
|
||||||
UNUSED(rxConfig);
|
UNUSED(rxConfig);
|
||||||
|
ibusSyncByte = 0;
|
||||||
|
|
||||||
rxRuntimeConfig->channelCount = IBUS_MAX_CHANNEL;
|
rxRuntimeConfig->channelCount = IBUS_MAX_CHANNEL;
|
||||||
rxRuntimeConfig->rxRefreshRate = 20000; // TODO - Verify speed
|
rxRuntimeConfig->rxRefreshRate = 20000; // TODO - Verify speed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue