Skip to content

AP_Scripting: fix cast-local-type in Rockblock and MAVLinkHL #29924

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 1 commit into from
Apr 29, 2025
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
3 changes: 1 addition & 2 deletions libraries/AP_Scripting/applets/RockBlock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,7 @@ function HLSatcom()
--- check if GCS telemetry has been lost for RCK_TIMEOUT sec (if param enabled)
if RCK_FORCEHL:get() == 2 then
-- link lost time = boot time - GCS last seen time
---@diagnostic disable-next-line cast-local-type
link_lost_for = millis():toint() - gcs:last_seen()
link_lost_for = (millis()- gcs:last_seen()):toint()
-- gcs:last_seen() is set to millis() during boot (on plane). 0 on rover/copter
-- So if it's less than 10000 assume no GCS packet received since boot
if link_lost_for > (RCK_TIMEOUT:get() * 1000) and not gcs:get_high_latency_status() and gcs:last_seen() > 10000 then
Expand Down
3 changes: 1 addition & 2 deletions libraries/AP_Scripting/examples/MAVLinkHL.lua
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ function HLSatcom()
-- if mode 1 and there's been no mavlink traffic for 5000 ms, enable high latency
if hl_mode == 1 then
-- link lost time = boot time - GCS last seen time
---@diagnostic disable-next-line cast-local-type
link_lost_for = millis():toint() - gcs:last_seen()
link_lost_for = (millis()- gcs:last_seen()):toint()
-- gcs:last_seen() is set to millis() during boot (on plane). 0 on rover/copter
-- So if it's less than 10000 assume no GCS packet received since boot
if link_lost_for > 5000 and not gcs:get_high_latency_status() and gcs:last_seen() > 10000 then
Expand Down
Loading