mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-24 00:35:14 +03:00
[Crossfire] Telemetry packets are bigger
This commit is contained in:
parent
d51e86b669
commit
9b5b9be50c
6 changed files with 16 additions and 8 deletions
|
@ -299,7 +299,7 @@ bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
|
|||
static int luaSportTelemetryPop(lua_State * L)
|
||||
{
|
||||
if (!luaInputTelemetryFifo) {
|
||||
luaInputTelemetryFifo = new Fifo<LuaTelemetryPacket, 16>();
|
||||
luaInputTelemetryFifo = new Fifo<LuaTelemetryPacket, LUA_TELEMETRY_FIFO_SIZE>();
|
||||
if (!luaInputTelemetryFifo) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ static int luaSportTelemetryPush(lua_State * L)
|
|||
static int luaCrossfireTelemetryPop(lua_State * L)
|
||||
{
|
||||
if (!luaInputTelemetryFifo) {
|
||||
luaInputTelemetryFifo = new Fifo<LuaTelemetryPacket, 16>();
|
||||
luaInputTelemetryFifo = new Fifo<LuaTelemetryPacket, LUA_TELEMETRY_FIFO_SIZE>();
|
||||
if (!luaInputTelemetryFifo) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -361,7 +361,6 @@ static int luaCrossfireTelemetryPop(lua_State * L)
|
|||
lua_pushinteger(L, packet.crossfire.data[i]);
|
||||
lua_settable(L, -3);
|
||||
}
|
||||
lua_settable(L, -3);
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ void checkTrainerSettings(void);
|
|||
#if defined(__cplusplus)
|
||||
#include "fifo.h"
|
||||
#include "dmafifo.h"
|
||||
extern Fifo<uint8_t, 32> telemetryFifo;
|
||||
extern Fifo<uint8_t, 64> telemetryFifo;
|
||||
extern DMAFifo<32> serial2RxFifo;
|
||||
extern Fifo<uint8_t, 32> sbusFifo;
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "opentx.h"
|
||||
|
||||
Fifo<uint8_t, 32> telemetryFifo;
|
||||
Fifo<uint8_t, 64> telemetryFifo;
|
||||
uint32_t telemetryErrors = 0;
|
||||
|
||||
void telemetryPortInit(uint32_t baudrate)
|
||||
|
|
|
@ -509,19 +509,22 @@ struct LuaTelemetryPacket
|
|||
}
|
||||
} sport;
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
struct {
|
||||
uint8_t command;
|
||||
uint8_t length;
|
||||
uint8_t data[8];
|
||||
uint8_t data[32];
|
||||
void clear()
|
||||
{
|
||||
command = 0x00;
|
||||
}
|
||||
} crossfire;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
extern Fifo<LuaTelemetryPacket, 16> * luaInputTelemetryFifo;
|
||||
#define LUA_TELEMETRY_FIFO_SIZE 8
|
||||
extern Fifo<LuaTelemetryPacket, LUA_TELEMETRY_FIFO_SIZE> * luaInputTelemetryFifo;
|
||||
extern LuaTelemetryPacket luaOutputTelemetryPacket;
|
||||
void sportSendLuaPacket(LuaTelemetryPacket & packet);
|
||||
#endif
|
||||
|
|
|
@ -460,6 +460,6 @@ NOINLINE uint8_t getRssiAlarmValue(uint8_t alarm)
|
|||
}
|
||||
|
||||
#if defined(LUA)
|
||||
Fifo<LuaTelemetryPacket, 16> * luaInputTelemetryFifo = NULL;
|
||||
Fifo<LuaTelemetryPacket, LUA_TELEMETRY_FIFO_SIZE> * luaInputTelemetryFifo = NULL;
|
||||
LuaTelemetryPacket luaOutputTelemetryPacket;
|
||||
#endif
|
||||
|
|
|
@ -60,7 +60,13 @@ extern uint8_t telemetryState;
|
|||
#endif
|
||||
|
||||
#define TELEMETRY_TIMEOUT10ms 100 // 1 second
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
#define TELEMETRY_RX_PACKET_SIZE 40
|
||||
#else
|
||||
#define TELEMETRY_RX_PACKET_SIZE 19 // 9 bytes (full packet), worst case 18 bytes with byte-stuffing (+1)
|
||||
#endif
|
||||
|
||||
|
||||
extern uint8_t telemetryRxBuffer[TELEMETRY_RX_PACKET_SIZE];
|
||||
extern uint8_t telemetryRxBufferCount;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue