Skip to content

Commit

Permalink
Merge pull request #447 from klutvott123/remove-gyro-pid-rate-for-4.2
Browse files Browse the repository at this point in the history
Remove gyro/pid rate for BF 4.2
  • Loading branch information
haslinghuis authored Sep 16, 2022
2 parents 7807026 + 188a884 commit cdd9ec2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/SCRIPTS/BF/PAGES/pwm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ local fields = {}

local gyroSampleRateKhz

if apiVersion >= 1.043 then
if apiVersion >= 1.044 then
gyroSampleRateKhz = assert(loadScript("BOARD_INFO/"..mcuId..".lua"))().gyroSampleRateHz / 1000
end

Expand Down Expand Up @@ -42,12 +42,14 @@ labels[#labels + 1] = { t = "System Config", x = x, y = inc.y(lineSpacing) }
if apiVersion >= 1.031 and apiVersion <= 1.040 then
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 }
end
if apiVersion >= 1.043 then
if apiVersion >= 1.044 then
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 }
else
elseif apiVersion <= 1.042 then
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 }
end
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 }
if apiVersion <= 1.042 or apiVersion >= 1.044 then
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 }
end

labels[#labels + 1] = { t = "ESC/Motor", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { t = "Protocol", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = #escProtocols, vals = { 4 }, table = escProtocols }
Expand Down
2 changes: 1 addition & 1 deletion src/SCRIPTS/BF/ui_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ local function init()
getVtxTables = nil
collectgarbage()
end
elseif not boardInfoReceived and apiVersion >= 1.043 then
elseif not boardInfoReceived and apiVersion >= 1.044 then
getBoardInfo = getBoardInfo or assert(loadScript("board_info.lua"))()
returnTable.t = getBoardInfo.t
boardInfoReceived = getBoardInfo.f()
Expand Down

0 comments on commit cdd9ec2

Please sign in to comment.