mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 16:55:29 +03:00
Use vtxCommonGetPowerPowerIndex when checking current power setting
This commit is contained in:
parent
e7b037cc45
commit
292b363dc6
1 changed files with 7 additions and 2 deletions
|
@ -2493,8 +2493,13 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
|
||||
if (sbufBytesRemaining(src) > 1) {
|
||||
uint8_t newPower = sbufReadU8(src);
|
||||
vtxCommonSetPowerByIndex(vtxDevice, newPower);
|
||||
vtxSettingsConfigMutable()->power = newPower;
|
||||
uint8_t currentPower = 0;
|
||||
vtxCommonGetPowerIndex(vtxDevice, ¤tPower);
|
||||
if (newPower != currentPower) {
|
||||
vtxCommonSetPowerByIndex(vtxDevice, newPower);
|
||||
vtxSettingsConfigMutable()->power = newPower;
|
||||
}
|
||||
|
||||
// Delegate pitmode to vtx directly
|
||||
const uint8_t newPitmode = sbufReadU8(src);
|
||||
uint8_t currentPitmode = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue