Skip to content

Commit 3add578

Browse files
authored
Merge pull request #118 from iNavFlight/improve_crsf_tests
improve CRSF test
2 parents d046c1f + 0af96dd commit 3add578

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/SCRIPTS/TELEMETRY/iNav/crsf.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ config[22].v = 0
2020
config[23].x = 1
2121

2222
local function crsf(data)
23-
if getValue(data.rssi_id) == 0 or getValue(data.rssi_id) == nil then
23+
local vtest
24+
vtest = getValue(data.rssi_id)
25+
if vtest == nil or vtest == 0 then
2426
--[[ Also check for RSSI2, in case RSSI2 is active with RSSI1 being inactive
2527
(Sometimes happens with True Diversity ELRS receivers on startup) ]]
2628
local rssi2 = getTelemetryId("2RSS")
27-
if getValue(rssi2) == 0 or getValue(rssi2) == nil then
28-
if getValue(data.tpwr_id) == 0 then
29+
vtest = getValue(rssi2)
30+
if vtest == nil or vtest == 0 then
31+
vtest = getValue(data.tpwr_id)
32+
if vtest == nil or vtest == 0 then
2933
data.rssi = 0
34+
data.tpwr = 0
3035
data.telem = false
3136
return 0
3237
end

0 commit comments

Comments
 (0)