Skip to content

Commit cdd9ec2

Browse files
authored
Merge pull request #447 from klutvott123/remove-gyro-pid-rate-for-4.2
Remove gyro/pid rate for BF 4.2
2 parents 7807026 + 188a884 commit cdd9ec2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/SCRIPTS/BF/PAGES/pwm.lua

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local fields = {}
1313

1414
local gyroSampleRateKhz
1515

16-
if apiVersion >= 1.043 then
16+
if apiVersion >= 1.044 then
1717
gyroSampleRateKhz = assert(loadScript("BOARD_INFO/"..mcuId..".lua"))().gyroSampleRateHz / 1000
1818
end
1919

@@ -42,12 +42,14 @@ labels[#labels + 1] = { t = "System Config", x = x, y = inc.y(lineSpacing) }
4242
if apiVersion >= 1.031 and apiVersion <= 1.040 then
4343
fields[#fields + 1] = { t = "32kHz Sampling", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 9 }, table = { [0] = "OFF", "ON" }, upd = function(self) self.updateRateTables(self) end }
4444
end
45-
if apiVersion >= 1.043 then
45+
if apiVersion >= 1.044 then
4646
fields[#fields + 1] = { t = "Gyro Update", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 1, max = 32, vals = { 1 }, table = {}, upd = function(self) self.updatePidRateTable(self) end, mult = -1, ro = true }
47-
else
47+
elseif apiVersion <= 1.042 then
4848
fields[#fields + 1] = { t = "Gyro Update", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 1, max = 32, vals = { 1 }, table = {}, upd = function(self) self.updatePidRateTable(self) end, mult = -1 }
4949
end
50-
fields[#fields + 1] = { t = "PID Loop", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 1, max = 16, vals = { 2 }, table = {}, mult = -1 }
50+
if apiVersion <= 1.042 or apiVersion >= 1.044 then
51+
fields[#fields + 1] = { t = "PID Loop", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 1, max = 16, vals = { 2 }, table = {}, mult = -1 }
52+
end
5153

5254
labels[#labels + 1] = { t = "ESC/Motor", x = x, y = inc.y(lineSpacing) }
5355
fields[#fields + 1] = { t = "Protocol", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = #escProtocols, vals = { 4 }, table = escProtocols }

src/SCRIPTS/BF/ui_init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ local function init()
4343
getVtxTables = nil
4444
collectgarbage()
4545
end
46-
elseif not boardInfoReceived and apiVersion >= 1.043 then
46+
elseif not boardInfoReceived and apiVersion >= 1.044 then
4747
getBoardInfo = getBoardInfo or assert(loadScript("board_info.lua"))()
4848
returnTable.t = getBoardInfo.t
4949
boardInfoReceived = getBoardInfo.f()

0 commit comments

Comments
 (0)