mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 07:15:18 +03:00
Add support for IRC Tramp race lock flag, and extended VTX status.
Display '-' for settings when VTX is locked.
This commit is contained in:
parent
8140504f84
commit
aeca5665e6
11 changed files with 154 additions and 79 deletions
|
@ -1544,11 +1544,11 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
|
|||
case MSP_VTX_CONFIG:
|
||||
{
|
||||
const vtxDevice_t *vtxDevice = vtxCommonDevice();
|
||||
uint8_t pitmode = 0;
|
||||
unsigned vtxStatus;
|
||||
vtxDevType_e vtxType = VTXDEV_UNKNOWN;
|
||||
uint8_t deviceIsReady = 0;
|
||||
if (vtxDevice) {
|
||||
vtxCommonGetPitMode(vtxDevice, &pitmode);
|
||||
vtxCommonGetStatus(vtxDevice, &vtxStatus);
|
||||
vtxType = vtxCommonGetDeviceType(vtxDevice);
|
||||
deviceIsReady = vtxCommonDeviceIsReady(vtxDevice) ? 1 : 0;
|
||||
}
|
||||
|
@ -1556,7 +1556,7 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
|
|||
sbufWriteU8(dst, vtxSettingsConfig()->band);
|
||||
sbufWriteU8(dst, vtxSettingsConfig()->channel);
|
||||
sbufWriteU8(dst, vtxSettingsConfig()->power);
|
||||
sbufWriteU8(dst, pitmode);
|
||||
sbufWriteU8(dst, (vtxStatus & VTX_STATUS_PIT_MODE) ? 1 : 0);
|
||||
sbufWriteU16(dst, vtxSettingsConfig()->freq);
|
||||
sbufWriteU8(dst, deviceIsReady);
|
||||
sbufWriteU8(dst, vtxSettingsConfig()->lowPowerDisarm);
|
||||
|
@ -2301,9 +2301,9 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
|
|||
if (vtxType != VTXDEV_UNKNOWN) {
|
||||
// Delegate pitmode to vtx directly
|
||||
const uint8_t newPitmode = sbufReadU8(src);
|
||||
uint8_t currentPitmode = 0;
|
||||
vtxCommonGetPitMode(vtxDevice, ¤tPitmode);
|
||||
if (currentPitmode != newPitmode) {
|
||||
unsigned vtxCurrentStatus;
|
||||
vtxCommonGetStatus(vtxDevice, &vtxCurrentStatus);
|
||||
if ((bool)(vtxCurrentStatus & VTX_STATUS_PIT_MODE) != (bool)newPitmode) {
|
||||
vtxCommonSetPitMode(vtxDevice, newPitmode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue