Spektrum CMS over TM performance increase.

This commit is contained in:
Anders Hoglund 2018-02-20 15:59:02 +01:00
parent 7c3bb49759
commit 29fd90bec9
1 changed files with 17 additions and 2 deletions

View File

@ -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) {