AP_Scripting: delay getting EFI backend

allow for AP_EFI startup after scripting
This commit is contained in:
Andrew Tridgell 2022-10-01 12:00:11 +10:00
parent 2f2d8246a8
commit c3de93eff3
1 changed files with 8 additions and 5 deletions

View File

@ -62,11 +62,7 @@ if not driver1 then
return return
end end
local efi_backend = efi:get_backend(0) local efi_backend = nil
if not efi_backend then
gcs:send_text(0, string.format("EFI_HFE: Failed to find EFI scripting backend"))
return
end
-- Setup EFI Parameters -- Setup EFI Parameters
assert(param:add_table(PARAM_TABLE_KEY, PARAM_TABLE_PREFIX, 5), 'could not add EFI_HFE param table') assert(param:add_table(PARAM_TABLE_KEY, PARAM_TABLE_PREFIX, 5), 'could not add EFI_HFE param table')
@ -270,6 +266,13 @@ local engine1 = engine_control(driver1, 1)
function update() function update()
now_s = get_time_sec() now_s = get_time_sec()
if not efi_backend then
efi_backend = efi:get_backend(0)
if not efi_backend then
return
end
end
-- Parse Driver Messages -- Parse Driver Messages
engine1.update_telemetry() engine1.update_telemetry()
engine1.send_throttle() engine1.send_throttle()