1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Spektrum CMS over TM performance increase.

This commit is contained in:
Anders Hoglund 2018-02-20 18:47:52 +01:00
parent 29fd90bec9
commit c8a42924f9
5 changed files with 9 additions and 5 deletions

View file

@ -71,7 +71,7 @@
#define CMS_MAX_DEVICE 4 #define CMS_MAX_DEVICE 4
#endif #endif
static displayPort_t *pCurrentDisplay; displayPort_t *pCurrentDisplay;
static displayPort_t *cmsDisplayPorts[CMS_MAX_DEVICE]; static displayPort_t *cmsDisplayPorts[CMS_MAX_DEVICE];
static int cmsDeviceCount; static int cmsDeviceCount;

View file

@ -8,6 +8,7 @@ extern bool cmsInMenu;
// Device management // Device management
bool cmsDisplayPortRegister(displayPort_t *pDisplay); bool cmsDisplayPortRegister(displayPort_t *pDisplay);
displayPort_t *pCurrentDisplay;
// For main.c and scheduler // For main.c and scheduler
void cmsInit(void); void cmsInit(void);

View file

@ -29,7 +29,7 @@
#include "telemetry/srxl.h" #include "telemetry/srxl.h"
static displayPort_t srxlDisplayPort; displayPort_t srxlDisplayPort;
static int srxlDrawScreen(displayPort_t *displayPort) static int srxlDrawScreen(displayPort_t *displayPort)
{ {

View file

@ -18,3 +18,4 @@
#pragma once #pragma once
displayPort_t *displayPortSrxlInit(); displayPort_t *displayPortSrxlInit();
displayPort_t srxlDisplayPort;

View file

@ -26,6 +26,7 @@
#include "build/version.h" #include "build/version.h"
#include "cms/cms.h" #include "cms/cms.h"
#include "io/displayport_srxl.h"
#include "common/crc.h" #include "common/crc.h"
#include "common/streambuf.h" #include "common/streambuf.h"
@ -234,7 +235,7 @@ static bool lineSent[SPEKTRUM_SRXL_DEVICE_TEXTGEN_ROWS];
int spektrumTmTextGenPutChar(uint8_t col, uint8_t row, char c) int spektrumTmTextGenPutChar(uint8_t col, uint8_t row, char c)
{ {
if (row < SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS && col < SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS) { if (row < SPEKTRUM_SRXL_TEXTGEN_BUFFER_ROWS && col < SPEKTRUM_SRXL_TEXTGEN_BUFFER_COLS) {
// Only update and force a tm transmision if something has actually changed. // Only update and force a tm transmision if something has actually changed.
if (srxlTextBuff[row][col] != c) { if (srxlTextBuff[row][col] != c) {
srxlTextBuff[row][col] = c; srxlTextBuff[row][col] = c;
lineSent[row] = false; lineSent[row] = false;
@ -472,8 +473,9 @@ static void processSrxl(timeUs_t currentTimeUs)
#if defined (USE_SPEKTRUM_CMS_TELEMETRY) && defined (USE_CMS) #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. // 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. // Sideeffect, all other reports are still not sent if user leaves CMS without a proper EXIT.
if (cmsInMenu) { if (cmsInMenu &&
srxlFnPtr = srxlFrameText; (pCurrentDisplay == &srxlDisplayPort)) {
srxlFnPtr = srxlFrameText;
} }
#endif #endif