Skip to content

Remove gyro/pid rate for BF 4.2 #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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