Skip to content
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

Add level angle limit #473

Merged
merged 1 commit into from
Mar 6, 2023
Merged
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
8 changes: 8 additions & 0 deletions src/SCRIPTS/BF/PAGES/pid_advanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ local inc = { x = function(val) x = x + val return x end, y = function(val) y =
local labels = {}
local fields = {}

if apiVersion >= 1.31 then
labels[#labels + 1] = { t = "Angle/Horizon", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { t = "Angle Limit", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 10, max = 90, vals = { 18 } }
if apiVersion < 1.36 then
fields[#fields + 1] = { t = "Stick Sensitivity", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 10, max = 200, vals = { 19 } }
end
Comment on lines +17 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed support for 1.41 and below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I mean we removed support for API 1.41 and below in general as we did in configurator assuming

if apiVersion >= 1.31 then 

would always be valid and no longer needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still possible to use the lua scripts with older firmware versions, so no, it won't always be valid. Conditionals like this also serve as documentation.
I don't think we should limit backwards compatibility in the lua scripts as long as it's not a maintenance nightmare. 🙂

end

if apiVersion >= 1.40 then
labels[#labels + 1] = { t = "Acro Trainer", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { t = "Angle Limit", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 20, max = 80, vals = { 32 } }
Expand Down