Skip to content

Commit

Permalink
chores: update to LUA 5.3 (#4203)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
  • Loading branch information
3 people authored Dec 24, 2024
1 parent 28b0cb9 commit 47cba22
Show file tree
Hide file tree
Showing 87 changed files with 9,426 additions and 6,692 deletions.
1 change: 1 addition & 0 deletions radio/src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <new>
#include <stdarg.h>

#include "lua/lua_states.h"

#define CLI_COMMAND_MAX_ARGS 8
#define CLI_COMMAND_MAX_LEN 256
Expand Down
14 changes: 8 additions & 6 deletions radio/src/edgetx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
#include <malloc.h>
#endif

#if defined(LUA)
#include "lua/lua_states.h"
#endif

RadioData g_eeGeneral;
ModelData g_model;

Expand Down Expand Up @@ -1085,10 +1089,6 @@ void edgeTxClose(uint8_t shutdown)
#endif
}

#if defined(LUA)
luaClose(&lsScripts);
#endif

logsClose();

storageFlushCurrentModel();
Expand All @@ -1112,11 +1112,13 @@ void edgeTxClose(uint8_t shutdown)
MainWindow::instance()->shutdown();
#if defined(LUA)
luaUnregisterWidgets();
luaClose(&lsWidgets);
lsWidgets = 0;
#endif
#endif

#if defined(LUA)
luaClose();
#endif

sdDone();
}

Expand Down
1 change: 1 addition & 0 deletions radio/src/gui/212x64/model_custom_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "edgetx.h"
#include "lua/lua_states.h"

void onModelCustomScriptMenu(const char *result)
{
Expand Down
2 changes: 2 additions & 0 deletions radio/src/gui/colorlcd/libui/bitmapbuffer_draw_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "telemetry/telemetry_sensors.h"
#include "translations.h"

#include <cmath>

// Drawing functions used by Lua API

void BitmapBuffer::invertRect(coord_t x, coord_t y, coord_t w, coord_t h,
Expand Down
1 change: 1 addition & 0 deletions radio/src/gui/colorlcd/mainview/view_statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "tasks.h"
#include "tasks/mixer_task.h"
#include "mixer_scheduler.h"
#include "lua/lua_states.h"

class StatisticsViewPage : public PageTab
{
Expand Down
2 changes: 1 addition & 1 deletion radio/src/gui/colorlcd/standalone_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void luaStandaloneInit()
lsStandaloneTrace.script = "lua_newstate(scripts)";
lsStandalone = lua_newstate(tracer_alloc, &lsStandaloneTrace); //we use tracer allocator
#else
lsStandalone = lua_newstate(l_alloc, nullptr); //we use Lua default allocator
lsStandalone = luaL_newstate(); //we use Lua default allocator
#endif
if (lsStandalone) {
// install our panic handler
Expand Down
1 change: 1 addition & 0 deletions radio/src/gui/common/stdlcd/popups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "edgetx.h"
#include <stdarg.h>

const char * warningText = nullptr;
const char * warningInfoText;
Expand Down
2 changes: 2 additions & 0 deletions radio/src/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ set(LUA_SRC
lstrlib.c
)

add_compile_definitions(LUA_COMPAT_5_2)

foreach(FILE ${LUA_SRC})
set(SRC ${SRC} ${LUA_DIR}/${FILE})
endforeach()
Loading

0 comments on commit 47cba22

Please sign in to comment.