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

One level back if Tramp is not configured

This commit is contained in:
jflyper 2019-02-18 21:30:31 +09:00
parent da7608f513
commit 69f6088497

View file

@ -172,8 +172,14 @@ static long trampCmsCommence(displayPort_t *pDisp, const void *self)
return MENU_CHAIN_BACK; return MENU_CHAIN_BACK;
} }
static void trampCmsInitSettings(void) static bool trampCmsInitSettings(void)
{ {
vtxDevice_t *device = vtxCommonDevice();
if (!device) {
return false;
}
if (trampBand > 0) trampCmsBand = trampBand; if (trampBand > 0) trampCmsBand = trampBand;
if (trampChannel > 0) trampCmsChan = trampChannel; if (trampChannel > 0) trampCmsChan = trampChannel;
@ -186,8 +192,6 @@ static void trampCmsInitSettings(void)
} }
} }
vtxDevice_t *device = vtxCommonDevice();
trampCmsEntBand.val = &trampCmsBand; trampCmsEntBand.val = &trampCmsBand;
trampCmsEntBand.max = device->capability.bandCount; trampCmsEntBand.max = device->capability.bandCount;
trampCmsEntBand.names = device->bandNames; trampCmsEntBand.names = device->bandNames;
@ -199,11 +203,16 @@ static void trampCmsInitSettings(void)
trampCmsEntPower.val = &trampCmsPower; trampCmsEntPower.val = &trampCmsPower;
trampCmsEntPower.max = device->capability.powerCount; trampCmsEntPower.max = device->capability.powerCount;
trampCmsEntPower.names = device->powerNames; trampCmsEntPower.names = device->powerNames;
return true;
} }
static long trampCmsOnEnter(void) static long trampCmsOnEnter(void)
{ {
trampCmsInitSettings(); if (!trampCmsInitSettings()) {
return MENU_CHAIN_BACK;
}
return 0; return 0;
} }