mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-02-08 16:02:18 +08:00
AP_Scripting: Add an initial generator
This commit is contained in:
committed by
WickedShell
parent
7c017568e4
commit
e7d59514d9
@@ -26,6 +26,8 @@
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include "lua_generated_bindings.h"
|
||||
|
||||
#ifndef SCRIPTING_DIRECTORY
|
||||
#if HAL_OS_FATFS_IO
|
||||
#define SCRIPTING_DIRECTORY "/APM/scripts"
|
||||
@@ -99,6 +101,7 @@ lua_scripts::script_info *lua_scripts::load_script(lua_State *L, char *filename)
|
||||
hal.console->printf("Lua: Scripting: Could not create sandbox: %s", lua_tostring(L, -1));
|
||||
return nullptr;
|
||||
}
|
||||
load_generated_sandbox(L);
|
||||
lua_setupvalue(L, -2, 1);
|
||||
|
||||
new_script->lua_ref = luaL_ref(L, LUA_REGISTRYINDEX); // cache the reference
|
||||
|
||||
Reference in New Issue
Block a user