Skip to content
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

chores: update to LUA 5.3 #4203

Merged
merged 13 commits into from
Dec 24, 2024
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
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
Loading