Display a message if band or power count is zero

This commit is contained in:
jflyper 2019-02-22 10:58:16 +09:00
parent 06d9f54f77
commit a66c03cafc
1 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <ctype.h>
#include <string.h>
#include "platform.h"
@ -47,6 +48,12 @@ char trampCmsStatusString[31] = "- -- ---- ----";
void trampCmsUpdateStatusString(void)
{
vtxDevice_t *vtxDevice = vtxCommonDevice();
if (vtxDevice->capability.bandCount == 0 || vtxDevice->capability.powerCount) {
strncpy(trampCmsStatusString, "PLEASE CONFIGURE VTXTABLE", sizeof(trampCmsStatusString));
return;
}
trampCmsStatusString[0] = '*';
trampCmsStatusString[1] = ' ';
trampCmsStatusString[2] = vtxCommonLookupBandLetter(vtxDevice, trampBand);