1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 12:55:12 +03:00

Fix Ghost menu glitch

This commit is contained in:
3djc 2020-11-22 13:52:56 +01:00
parent 4555be0286
commit 2dfa8a80ab
3 changed files with 4 additions and 4 deletions

View file

@ -1131,6 +1131,7 @@ union ReusableBuffer
#if defined(GHOST)
struct {
GhostMenuData line[GHST_MENU_LINES + 1];
uint8_t menuFlags;
uint8_t menuAction;
uint8_t buttonAction;
} ghostMenu;

View file

@ -22,8 +22,6 @@
uint8_t createGhostMenuControlFrame(uint8_t * frame, int16_t * pulses)
{
moduleState[EXTERNAL_MODULE].counter = GHST_FRAME_CHANNEL;
uint8_t * buf = frame;
#if SPORT_MAX_BAUDRATE < 400000
*buf++ = g_eeGeneral.telemetryBaudrate == GHST_TELEMETRY_RATE_400K ? GHST_ADDR_MODULE_SYM : GHST_ADDR_MODULE_ASYM;
@ -118,5 +116,7 @@ void setupPulsesGhost()
extmodulePulsesData.ghost.length = createGhostMenuControlFrame(pulses, &channelOutputs[g_model.moduleData[EXTERNAL_MODULE].channelsStart]);
else
extmodulePulsesData.ghost.length = createGhostChannelsFrame(pulses, &channelOutputs[g_model.moduleData[EXTERNAL_MODULE].channelsStart]);
moduleState[EXTERNAL_MODULE].counter = GHST_FRAME_CHANNEL;
}
}

View file

@ -192,11 +192,10 @@ void processGhostTelemetryFrame()
{
GhostMenuFrame * packet;
GhostMenuData * lineData;
packet = (GhostMenuFrame * ) telemetryRxBuffer;
lineData = (GhostMenuData *) &reusableBuffer.ghostMenu.line[packet->lineIndex];
lineData->splitLine = 0;
reusableBuffer.ghostMenu.menuAction = packet->menuFlags;
reusableBuffer.ghostMenu.menuFlags = packet->menuFlags;
lineData->lineFlags = packet->lineFlags;
for (uint8_t i = 0; i < GHST_MENU_CHARS; i++) {
if (packet->menuText[i] == 0x7C) {