diff --git a/src/main/io/vtx_smartaudio.c b/src/main/io/vtx_smartaudio.c index 2f12f3b58b..cb057f0fc5 100644 --- a/src/main/io/vtx_smartaudio.c +++ b/src/main/io/vtx_smartaudio.c @@ -195,7 +195,6 @@ static void saPrintSettings(void) LOG_D(VTX, "BootIntoPitMode: %s", saDevice.willBootIntoPitMode ? "yes" : "no"); } -/* int saDacToPowerIndex(int dac) { for (int idx = saPowerCount - 1 ; idx >= 0 ; idx--) { @@ -205,7 +204,6 @@ int saDacToPowerIndex(int dac) } return 0; } -*/ int saDbiToMw(uint16_t dbi) { @@ -796,7 +794,7 @@ vtxDevType_e vtxSAGetDeviceType(const vtxDevice_t *vtxDevice) static bool vtxSAIsReady(const vtxDevice_t *vtxDevice) { - return vtxDevice != NULL && (saDevice.power >= 0 ); + return vtxDevice != NULL && !(saDevice.power == 0); //wait until power reading exists } @@ -914,7 +912,7 @@ static bool vtxSAGetPowerIndex(const vtxDevice_t *vtxDevice, uint8_t *pIndex) return false; } - *pIndex = saDevice.power; + *pIndex = ((saDevice.version == SA_1_0) ? saDacToPowerIndex(saDevice.power) : saDevice.power); return true; } diff --git a/src/main/io/vtx_smartaudio.h b/src/main/io/vtx_smartaudio.h index 914995f1f2..c817f05a79 100644 --- a/src/main/io/vtx_smartaudio.h +++ b/src/main/io/vtx_smartaudio.h @@ -72,7 +72,7 @@ typedef enum { typedef struct smartAudioDevice_s { smartAudioVersion_e version; int8_t channel; - int8_t power; // -1 - not initialized, 0 - power level unknown, or power level index 1..n. For SA_2_1 device you can get power in mW: saPowerTable[index-1].mW + int8_t power; int8_t mode; uint16_t freq; uint16_t orfreq;