mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 11:29:51 +03:00
Compilation fix
This commit is contained in:
parent
3a7e006635
commit
42a59dca35
5 changed files with 10 additions and 10 deletions
|
@ -180,7 +180,7 @@ void Bluetooth::processTrainerByte(uint8_t data)
|
|||
break;
|
||||
|
||||
case STATE_DATA_IN_FRAME:
|
||||
if (data == BYTESTUFF) {
|
||||
if (data == BYTE_STUFF) {
|
||||
dataState = STATE_DATA_XOR; // XOR next byte
|
||||
}
|
||||
else if (data == START_STOP) {
|
||||
|
@ -225,8 +225,8 @@ void Bluetooth::processTrainerByte(uint8_t data)
|
|||
void Bluetooth::pushByte(uint8_t byte)
|
||||
{
|
||||
crc ^= byte;
|
||||
if (byte == START_STOP || byte == BYTESTUFF) {
|
||||
buffer[bufferIndex++] = 0x7d;
|
||||
if (byte == START_STOP || byte == BYTE_STUFF) {
|
||||
buffer[bufferIndex++] = BYTE_STUFF;
|
||||
byte ^= STUFF_MASK;
|
||||
}
|
||||
buffer[bufferIndex++] = byte;
|
||||
|
|
|
@ -353,7 +353,7 @@ void sendSport(uint8_t moduleIdx)
|
|||
|
||||
// unstuff and remove crc
|
||||
for (uint8_t i = 0; i < outputTelemetryBuffer.size - 1 && j < 8; i++, j++) {
|
||||
if (outputTelemetryBuffer.data[i] == BYTESTUFF) {
|
||||
if (outputTelemetryBuffer.data[i] == BYTE_STUFF) {
|
||||
i++;
|
||||
sendMulti(moduleIdx, outputTelemetryBuffer.data[i] ^ STUFF_MASK);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ bool pushFrskyTelemetryData(uint8_t data)
|
|||
break;
|
||||
|
||||
case STATE_DATA_IN_FRAME:
|
||||
if (data == BYTESTUFF) {
|
||||
if (data == BYTE_STUFF) {
|
||||
dataState = STATE_DATA_XOR; // XOR next byte
|
||||
}
|
||||
else if (data == START_STOP) {
|
||||
|
|
|
@ -234,9 +234,9 @@ inline uint8_t TELEMETRY_RSSI()
|
|||
return telemetryData.rssi.value();
|
||||
}
|
||||
|
||||
#define START_STOP 0x7E
|
||||
#define BYTESTUFF 0x7D
|
||||
#define STUFF_MASK 0x20
|
||||
constexpr uint8_t START_STOP = 0x7E;
|
||||
constexpr uint8_t BYTE_STUFF = 0x7D;
|
||||
constexpr uint8_t STUFF_MASK = 0x20;
|
||||
|
||||
typedef enum {
|
||||
TS_IDLE = 0, // waiting for 0x5e frame marker
|
||||
|
|
|
@ -10,7 +10,7 @@ import struct
|
|||
|
||||
|
||||
START_STOP = '\x7e'
|
||||
BYTESTUFF = '\x7d'
|
||||
BYTE_STUFF = '\x7d'
|
||||
STUFF_MASK = '\x20'
|
||||
|
||||
DATA_FRAME = 0x10
|
||||
|
@ -110,7 +110,7 @@ def ParsePacket(packet):
|
|||
global lineNumber
|
||||
# unstuff packet
|
||||
while True:
|
||||
pos = packet.find(BYTESTUFF)
|
||||
pos = packet.find(BYTE_STUFF)
|
||||
if pos == -1:
|
||||
break
|
||||
# print "found stuff at %d in %s" % (pos, dump(packet, 20))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue