diff --git a/src/main/telemetry/srxl.c b/src/main/telemetry/srxl.c index 7c783585c..5970436e8 100644 --- a/src/main/telemetry/srxl.c +++ b/src/main/telemetry/srxl.c @@ -25,6 +25,8 @@ #include "build/version.h" +#include "cms/cms.h" + #include "common/crc.h" #include "common/streambuf.h" #include "common/utils.h" @@ -232,8 +234,11 @@ static bool lineSent[SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS]; int spektrumTmTextGenPutChar(uint8_t col, uint8_t row, char c) { if (row < SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS && col < SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS) { - srxlTextBuff[row][col] = c; - lineSent[row] = false; + // Only update and force a tm transmision if something has actually changed. + if (srxlTextBuff[row][col] != c) { + srxlTextBuff[row][col] = c; + lineSent[row] = false; + } } return 0; } @@ -448,6 +453,7 @@ const srxlScheduleFnPtr srxlScheduleFuncs[SRXL_TOTAL_COUNT] = { #endif }; + static void processSrxl(timeUs_t currentTimeUs) { static uint8_t srxlScheduleIndex = 0; @@ -462,6 +468,15 @@ static void processSrxl(timeUs_t currentTimeUs) } else { srxlFnPtr = srxlScheduleFuncs[srxlScheduleIndex + srxlScheduleUserIndex]; srxlScheduleUserIndex = (srxlScheduleUserIndex + 1) % SRXL_SCHEDULE_USER_COUNT; + +#if defined (USE_SPEKTRUM_CMS_TELEMETRY) && defined (USE_CMS) + // Boost CMS performance by sending nothing else but CMS Text frames when in a CMS menu. + // Sideeffect, all other reports are still not sent if user leaves CMS without a proper EXIT. + if (cmsInMenu) { + srxlFnPtr = srxlFrameText; + } +#endif + } if (srxlFnPtr) {