Skip to content

Commit

Permalink
AP_Scripting: added lua binding get_last_update for efi and esc
Browse files Browse the repository at this point in the history
  • Loading branch information
loki077 authored and peterbarker committed Aug 19, 2024
1 parent 94059ed commit 46c98d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ efi = {}
---@return EFI_State_ud
function efi:get_state() end

-- get last update time in milliseconds
---@return uint32_t_ud
function efi:get_last_update_ms() end

-- desc
---@param instance integer
---@return AP_EFI_Backend_ud|nil
Expand Down Expand Up @@ -2073,6 +2077,11 @@ function esc_telem:update_rpm(esc_index, rpm, error_rate) end
---@param scale_factor number -- factor
function esc_telem:set_rpm_scale(esc_index, scale_factor) end

-- get the timestamp of last telemetry data for an ESC
---@param esc_index integer
---@return uint32_t_ud
function esc_telem:get_last_telem_data_ms(esc_index) end

-- desc
optical_flow = {}

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ singleton AP_ESC_Telem method get_usage_seconds boolean uint8_t 0 NUM_SERVO_CHAN
singleton AP_ESC_Telem method update_rpm void uint8_t 0 NUM_SERVO_CHANNELS uint16_t'skip_check float'skip_check
singleton AP_ESC_Telem method update_telem_data void uint8_t 0 NUM_SERVO_CHANNELS AP_ESC_Telem_Backend::TelemetryData uint16_t'skip_check
singleton AP_ESC_Telem method set_rpm_scale void uint8_t 0 NUM_SERVO_CHANNELS float'skip_check
singleton AP_ESC_Telem method get_last_telem_data_ms uint32_t uint8_t 0 ESC_TELEM_MAX_ESCS

include AP_Param/AP_Param.h
singleton AP_Param rename param
Expand Down Expand Up @@ -851,6 +852,7 @@ singleton AP_EFI depends (AP_EFI_SCRIPTING_ENABLED == 1)
singleton AP_EFI rename efi
singleton AP_EFI method get_backend AP_EFI_Backend uint8_t'skip_check
singleton AP_EFI method get_state void EFI_State'Ref
singleton AP_EFI method get_last_update_ms uint32_t

-- ----END EFI Library----

Expand Down

0 comments on commit 46c98d6

Please sign in to comment.