1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Corrected VTX vtables to not use static device handle

This commit is contained in:
Martin Budden 2018-02-01 09:24:57 +00:00
parent f000d7bf10
commit e2683cd2dc
14 changed files with 259 additions and 281 deletions

View file

@ -588,7 +588,8 @@ static void applyLedVtxLayer(bool updateNow, timeUs_t *timer)
static uint16_t lastCheck = 0;
static bool blink = false;
if (!vtxCommonDeviceRegistered()) {
const vtxDevice_t *vtxDevice = vtxCommonDevice();
if (!vtxDevice) {
return;
}
@ -597,9 +598,9 @@ static void applyLedVtxLayer(bool updateNow, timeUs_t *timer)
if (updateNow) {
// keep counter running, so it stays in sync with vtx
vtxCommonGetBandAndChannel(&band, &channel);
vtxCommonGetPowerIndex(&power);
vtxCommonGetPitMode(&pit);
vtxCommonGetBandAndChannel(vtxDevice, &band, &channel);
vtxCommonGetPowerIndex(vtxDevice, &power);
vtxCommonGetPitMode(vtxDevice, &pit);
frequency = vtx58frequencyTable[band - 1][channel - 1]; //subtracting 1 from band and channel so that correct frequency is returned.
//might not be correct for tramp but should fix smart audio.