Bsongis/crossfire refactoring (#3613)

* Crossfire refactoring

* Crossfire script now displaying fields

* Crossfire script now displaying text selection values
This commit is contained in:
Bertrand Songis
2016-06-18 22:16:50 +02:00
committed by GitHub
parent ab58151f2a
commit 53b51cac94
16 changed files with 288 additions and 177 deletions
+1 -17
View File
@@ -2,7 +2,7 @@
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
@@ -46,19 +46,3 @@ uint8_t createCrossfireChannelsFrame(uint8_t * frame, int16_t * pulses)
*buf++ = crc8(crc_start, 23);
return buf - frame;
}
#if defined(LUA)
uint8_t createCrossfireRequestFrame(uint8_t * frame, LuaTelemetryPacket * telemetryPacket)
{
uint8_t * buf = frame;
*buf++ = MODULE_ADDRESS;
*buf++ = 2 + telemetryPacket->crossfire.length; // 1(ID) + telemetryPacket->crossfire.length + 1(CRC)
uint8_t * crc_start = buf;
*buf++ = telemetryPacket->crossfire.command;
for (int i=0; i<telemetryPacket->crossfire.length; i++) {
*buf++ = telemetryPacket->crossfire.data[i];
}
*buf++ = crc8(crc_start, telemetryPacket->crossfire.length + 1);
return buf - frame;
}
#endif