@@ -103,11 +103,6 @@ bool menuRadioTools(event_t event)
|
||||
FILINFO fno;
|
||||
DIR dir;
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
if(isFileAvailable(SCRIPTS_TOOLS_PATH "/CROSSFIRE/crossfire.lua"))
|
||||
addRadioScriptTool(index++, SCRIPTS_TOOLS_PATH "/CROSSFIRE/crossfire.lua");
|
||||
#endif
|
||||
|
||||
FRESULT res = f_opendir(&dir, SCRIPTS_TOOLS_PATH);
|
||||
if (res == FR_OK) {
|
||||
for (;;) {
|
||||
|
||||
@@ -102,11 +102,6 @@ void menuRadioTools(event_t event)
|
||||
FILINFO fno;
|
||||
DIR dir;
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
if(isFileAvailable(SCRIPTS_TOOLS_PATH "/CROSSFIRE/crossfire.lua"))
|
||||
addRadioScriptTool(index++, SCRIPTS_TOOLS_PATH "/CROSSFIRE/crossfire.lua");
|
||||
#endif
|
||||
|
||||
FRESULT res = f_opendir(&dir, SCRIPTS_TOOLS_PATH);
|
||||
if (res == FR_OK) {
|
||||
for (;;) {
|
||||
|
||||
@@ -1357,6 +1357,24 @@ static int luaGetRSSI(lua_State * L)
|
||||
return 3;
|
||||
}
|
||||
|
||||
/*luadoc
|
||||
@function chdir(directory)
|
||||
|
||||
Change the working directory
|
||||
|
||||
@param directory (string) New working directory
|
||||
|
||||
@status current Introduced in 2.3.0
|
||||
|
||||
*/
|
||||
|
||||
static int luaChdir(lua_State * L)
|
||||
{
|
||||
const char * directory = luaL_optstring(L, 1, nullptr);
|
||||
f_chdir(directory);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*luadoc
|
||||
@function loadScript(file [, mode], [,env])
|
||||
|
||||
@@ -1554,6 +1572,7 @@ const luaL_Reg opentxLib[] = {
|
||||
{ "defaultChannel", luaDefaultChannel },
|
||||
{ "getRSSI", luaGetRSSI },
|
||||
{ "killEvents", luaKillEvents },
|
||||
{ "chdir", luaChdir },
|
||||
{ "loadScript", luaLoadScript },
|
||||
{ "getUsage", luaGetUsage },
|
||||
{ "resetGlobalTimer", luaResetGlobalTimer },
|
||||
|
||||
Reference in New Issue
Block a user