Merge pull request #7638 from jflyper/bfdev-tramp-display-invalid-vtxtable-if-band-or-power-count-is-zero

[VTX, TRAMP] Display a message if band or power count is zero
This commit is contained in:
Michael Keller 2019-02-23 16:22:40 +13:00 committed by GitHub
commit 9bf65ba628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);