mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 20:35:17 +03:00
Compilation fixes
This commit is contained in:
parent
469f6f860e
commit
fa6db9e330
8 changed files with 38 additions and 55 deletions
|
@ -568,21 +568,21 @@ When called without parameters, it will only return the status of the output buf
|
|||
static int luaCrossfireTelemetryPush(lua_State * L)
|
||||
{
|
||||
if (lua_gettop(L) == 0) {
|
||||
lua_pushboolean(L, isCrossfireOutputBufferAvailable());
|
||||
lua_pushboolean(L, outputTelemetryBuffer.isAvailable());
|
||||
}
|
||||
else if (isCrossfireOutputBufferAvailable()) {
|
||||
else if (outputTelemetryBuffer.isAvailable()) {
|
||||
uint8_t command = luaL_checkunsigned(L, 1);
|
||||
luaL_checktype(L, 2, LUA_TTABLE);
|
||||
uint8_t length = luaL_len(L, 2);
|
||||
telemetryOutputPushByte(MODULE_ADDRESS);
|
||||
telemetryOutputPushByte(2 + length); // 1(COMMAND) + data length + 1(CRC)
|
||||
telemetryOutputPushByte(command); // COMMAND
|
||||
outputTelemetryBuffer.pushByte(MODULE_ADDRESS);
|
||||
outputTelemetryBuffer.pushByte(2 + length); // 1(COMMAND) + data length + 1(CRC)
|
||||
outputTelemetryBuffer.pushByte(command); // COMMAND
|
||||
for (int i=0; i<length; i++) {
|
||||
lua_rawgeti(L, 2, i+1);
|
||||
telemetryOutputPushByte(luaL_checkunsigned(L, -1));
|
||||
outputTelemetryBuffer.pushByte(luaL_checkunsigned(L, -1));
|
||||
}
|
||||
telemetryOutputPushByte(crc8(outputTelemetryBuffer+2, 1 + length));
|
||||
telemetryOutputSetTrigger(command);
|
||||
outputTelemetryBuffer.pushByte(crc8(outputTelemetryBuffer.data+2, 1 + length));
|
||||
outputTelemetryBuffer.setDestination(TELEMETRY_ENDPOINT_SPORT);
|
||||
lua_pushboolean(L, true);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue