From c7b6a13387a64cf38a35e5f295bd94baf4034e0f Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 11 Feb 2024 21:36:18 +0000 Subject: [PATCH] revert: 175ab5e pushed to wrong fork This reverts commit 175ab5ef964b37b72b89e37943ac751a61209fd5. --- radio/src/lua/api_general.cpp | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index d4bc3bc54..fdb447370 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -1194,38 +1194,15 @@ static int luaCrossfireTelemetryPush(lua_State * L) uint8_t command = luaL_checkunsigned(L, 1); luaL_checktype(L, 2, LUA_TTABLE); uint8_t length = luaL_len(L, 2); - - // 1st byte - DEVICE_ADDRESS (sender device address) outputTelemetryBuffer.pushByte(MODULE_ADDRESS); - - // 2nd byte - FRAME_LENGTH (counted from COMMAND) - if (command == COMMAND_ID) { - outputTelemetryBuffer.pushByte(3 + length); // 1(COMMAND) + length(DATA) + 1(CRC_BA) + 1(CRC_D5) - } else { - outputTelemetryBuffer.pushByte(2 + length); // 1(COMMAND) + length(DATA) + 1(CRC_D5) - } - - // 3rd byte COMMAND (CRSF frame type ID) - outputTelemetryBuffer.pushByte(command); - - // x bytes DATA (Payload) - for (int i = 0; i < length; i++) { - lua_rawgeti(L, 2, i + 1); + outputTelemetryBuffer.pushByte(2 + length); // 1(COMMAND) + data length + 1(CRC) + outputTelemetryBuffer.pushByte(command); // COMMAND + for (int i=0; i