mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 14:25:11 +03:00
More custom scripts (7 instead of 3)
This commit is contained in:
parent
5a7fda2f81
commit
7c4214d5b9
6 changed files with 8 additions and 8 deletions
|
@ -856,7 +856,7 @@ class ModuleData {
|
||||||
void clear() { memset(this, 0, sizeof(ModuleData)); }
|
void clear() { memset(this, 0, sizeof(ModuleData)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define C9X_MAX_SCRIPTS 3
|
#define C9X_MAX_SCRIPTS 7
|
||||||
#define C9X_MAX_SCRIPT_INPUTS 10
|
#define C9X_MAX_SCRIPT_INPUTS 10
|
||||||
class ScriptData {
|
class ScriptData {
|
||||||
public:
|
public:
|
||||||
|
|
1
radio/src/.gitignore
vendored
1
radio/src/.gitignore
vendored
|
@ -14,3 +14,4 @@
|
||||||
/SOUNDS
|
/SOUNDS
|
||||||
/LOGS
|
/LOGS
|
||||||
/*.bat
|
/*.bat
|
||||||
|
/TEMPLATES
|
||||||
|
|
|
@ -5139,8 +5139,8 @@ void onModelCustomScriptMenu(const char *result)
|
||||||
ScriptData &sd = g_model.scriptsData[s_currIdx];
|
ScriptData &sd = g_model.scriptsData[s_currIdx];
|
||||||
|
|
||||||
if (result == STR_UPDATE_LIST) {
|
if (result == STR_UPDATE_LIST) {
|
||||||
if (!listSdFiles(SCRIPTS_PATH, MIXES_EXT, sizeof(sd.file), NULL)) {
|
if (!listSdFiles(SCRIPTS_PATH, SCRIPTS_EXT, sizeof(sd.file), NULL)) {
|
||||||
POPUP_WARNING(STR_NO_BITMAPS_ON_SD);
|
POPUP_WARNING(STR_NO_SCRIPTS_ON_SD);
|
||||||
s_menu_flags = 0;
|
s_menu_flags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5187,7 +5187,7 @@ void menuModelCustomScriptOne(uint8_t event)
|
||||||
lcd_putsiAtt(SCRIPT_ONE_2ND_COLUMN_POS, y, STR_VCSWFUNC, 0, attr);
|
lcd_putsiAtt(SCRIPT_ONE_2ND_COLUMN_POS, y, STR_VCSWFUNC, 0, attr);
|
||||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && !READ_ONLY()) {
|
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && !READ_ONLY()) {
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
if (listSdFiles(SCRIPTS_PATH, MIXES_EXT, sizeof(sd.file), sd.file, LIST_NONE_SD_FILE)) {
|
if (listSdFiles(SCRIPTS_PATH, SCRIPTS_EXT, sizeof(sd.file), sd.file, LIST_NONE_SD_FILE)) {
|
||||||
menuHandler = onModelCustomScriptMenu;
|
menuHandler = onModelCustomScriptMenu;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -935,10 +935,10 @@ void luaLoadModelScript(uint8_t index)
|
||||||
sid.state = SCRIPT_NOFILE;
|
sid.state = SCRIPT_NOFILE;
|
||||||
|
|
||||||
if (ZEXIST(sd.file)) {
|
if (ZEXIST(sd.file)) {
|
||||||
char filename[sizeof(SCRIPTS_PATH)+sizeof(sd.file)+sizeof(MIXES_EXT)] = SCRIPTS_PATH "/";
|
char filename[sizeof(SCRIPTS_PATH)+sizeof(sd.file)+sizeof(SCRIPTS_EXT)] = SCRIPTS_PATH "/";
|
||||||
strncpy(filename+sizeof(SCRIPTS_PATH), sd.file, sizeof(sd.file));
|
strncpy(filename+sizeof(SCRIPTS_PATH), sd.file, sizeof(sd.file));
|
||||||
filename[sizeof(SCRIPTS_PATH)+sizeof(sd.file)] = '\0';
|
filename[sizeof(SCRIPTS_PATH)+sizeof(sd.file)] = '\0';
|
||||||
strcat(filename+sizeof(SCRIPTS_PATH), MIXES_EXT);
|
strcat(filename+sizeof(SCRIPTS_PATH), SCRIPTS_EXT);
|
||||||
luaLoad(filename, sid);
|
luaLoad(filename, sid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
#define MAX_EXPOS 64
|
#define MAX_EXPOS 64
|
||||||
#define NUM_CSW 32 // number of custom switches
|
#define NUM_CSW 32 // number of custom switches
|
||||||
#define NUM_CFN 64 // number of functions assigned to switches
|
#define NUM_CFN 64 // number of functions assigned to switches
|
||||||
#define MAX_SCRIPTS 3
|
#define MAX_SCRIPTS 7
|
||||||
#define MAX_INPUTS 32
|
#define MAX_INPUTS 32
|
||||||
#elif defined(CPUARM)
|
#elif defined(CPUARM)
|
||||||
#define MAX_MODELS 60
|
#define MAX_MODELS 60
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
#define SOUNDS_EXT ".wav"
|
#define SOUNDS_EXT ".wav"
|
||||||
#define BITMAPS_EXT ".bmp"
|
#define BITMAPS_EXT ".bmp"
|
||||||
#define SCRIPTS_EXT ".lua"
|
#define SCRIPTS_EXT ".lua"
|
||||||
#define MIXES_EXT ".mix"
|
|
||||||
#define TEXT_EXT ".txt"
|
#define TEXT_EXT ".txt"
|
||||||
|
|
||||||
extern FATFS g_FATFS_Obj;
|
extern FATFS g_FATFS_Obj;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue