diff --git a/radio/src/bitmaps/horus/bmp_sleep.png b/radio/src/bitmaps/horus/bmp_sleep.png deleted file mode 100644 index 70e163272..000000000 Binary files a/radio/src/bitmaps/horus/bmp_sleep.png and /dev/null differ diff --git a/radio/src/bitmaps/horus/calibration/bmp_horus.png b/radio/src/bitmaps/horus/calibration/bmp_horus.png deleted file mode 100644 index a4dd81310..000000000 Binary files a/radio/src/bitmaps/horus/calibration/bmp_horus.png and /dev/null differ diff --git a/radio/src/bitmaps/horus/calibration/bmp_stick_background.png b/radio/src/bitmaps/horus/calibration/bmp_stick_background.png deleted file mode 100644 index 903430723..000000000 Binary files a/radio/src/bitmaps/horus/calibration/bmp_stick_background.png and /dev/null differ diff --git a/radio/src/gui/horus/bitmaps.cpp b/radio/src/gui/horus/bitmaps.cpp index 2104a4c86..1c83cc7a3 100644 --- a/radio/src/gui/horus/bitmaps.cpp +++ b/radio/src/gui/horus/bitmaps.cpp @@ -259,11 +259,11 @@ const uint8_t LBM_STAR1[] __DMA = { */ const uint8_t LBM_HORUS[] __DMA = { -#include "bmp_horus.lbm" +#include "alpha_horus.lbm" }; const uint8_t LBM_STICK_BACKGROUND[] __DMA = { -#include "bmp_stick_background.lbm" +#include "alpha_stick_background.lbm" }; const uint8_t LBM_STICK_POINTER[] __DMA = { @@ -299,7 +299,7 @@ const uint8_t LBM_SHUTDOWN[] __DMA = { }; const uint8_t LBM_SLEEP[] __DMA = { -#include "bmp_sleep.lbm" +#include "alpha_sleep.lbm" }; const uint8_t LBM_SHUTDOWN_CIRCLE[] __DMA = { diff --git a/radio/src/gui/horus/layout.cpp b/radio/src/gui/horus/layout.cpp index e22f8b629..61d62595b 100644 --- a/radio/src/gui/horus/layout.cpp +++ b/radio/src/gui/horus/layout.cpp @@ -75,3 +75,17 @@ Layout * loadLayout(const char * name, Layout::PersistentData * persistentData) } return NULL; } + +void loadCustomScreens() +{ + for (unsigned int i=0; icreate(&g_model.screenData[0].layoutData); + } +} \ No newline at end of file diff --git a/radio/src/gui/horus/layout.h b/radio/src/gui/horus/layout.h index 885ecf38e..0bc6cfe11 100644 --- a/radio/src/gui/horus/layout.h +++ b/radio/src/gui/horus/layout.h @@ -161,5 +161,6 @@ class BaseLayoutFactory: public LayoutFactory extern unsigned int countRegisteredLayouts; extern const LayoutFactory * registeredLayouts[MAX_REGISTERED_LAYOUTS]; Layout * loadLayout(const char * name, Layout::PersistentData * persistentData); +void loadCustomScreens(); #endif // _LAYOUT_H_ diff --git a/radio/src/gui/horus/menu_general_calib.cpp b/radio/src/gui/horus/menu_general_calib.cpp index 50c0a37db..404dd5ae6 100644 --- a/radio/src/gui/horus/menu_general_calib.cpp +++ b/radio/src/gui/horus/menu_general_calib.cpp @@ -182,7 +182,7 @@ bool menuCommonCalib(evt_t event) break; } - lcdDrawBitmap((LCD_W-206)/2, LCD_H-220, LBM_HORUS); + lcdDrawAlphaBitmap((LCD_W-206)/2, LCD_H-220, LBM_HORUS); drawSticks(); drawPots(); diff --git a/radio/src/gui/horus/screens_setup.cpp b/radio/src/gui/horus/screens_setup.cpp index f72c91e20..82e555589 100644 --- a/radio/src/gui/horus/screens_setup.cpp +++ b/radio/src/gui/horus/screens_setup.cpp @@ -301,10 +301,9 @@ bool menuScreensTheme(evt_t event) lcdDrawText(MENUS_MARGIN_LEFT, y + FH / 2, "Theme"); const Theme * new_theme = editThemeChoice(SCREENS_SETUP_2ND_COLUMN, y, registeredThemes, countRegisteredThemes, theme, needsOffsetCheck, attr, event); if (new_theme) { - theme = new_theme; - theme->load(); - // strncpy(g_model.screenData[T].layoutName, factory->getName(), sizeof(g_model.screenData[T].layoutName)); - storageDirty(EE_MODEL); + loadTheme(new_theme); + strncpy(g_eeGeneral.themeName, new_theme->getName(), sizeof(g_eeGeneral.themeName)); + storageDirty(EE_GENERAL); } break; } @@ -317,12 +316,8 @@ bool menuScreensTheme(evt_t event) return true; } -bool menuScreenAdd(evt_t event) -{ - menuPageCount = updateMainviewsMenu(); - MENU_WITH_OPTIONS("Add main view", LBM_MAINVIEWS_ICONS, menuTabMainviews, menuPageCount, menuPageCount-1, 0, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 }); - return true; -} +bool menuScreenAdd(evt_t event); +void onScreenSetupMenu(const char * result); template bool menuScreenSetup(evt_t event) @@ -342,6 +337,8 @@ bool menuScreenSetup(evt_t event) menuPageCount = updateMainviewsMenu(); MENU_WITH_OPTIONS(title, LBM_MAINVIEWS_ICONS, menuTabMainviews, menuPageCount, T+1, linesCount, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 }); + + for (int i=0; i 0 && event == EVT_KEY_LONG(KEY_ENTER)) { + killEvents(KEY_ENTER); + menuHorizontalPosition = T; + POPUP_MENU_ADD_ITEM(STR_REMOVE_SCREEN); + popupMenuHandler = onScreenSetupMenu; + } + return true; } @@ -419,3 +423,31 @@ int updateMainviewsMenu() } return 1+MAX_CUSTOM_SCREENS; } + +bool menuScreenAdd(evt_t event) +{ + menuPageCount = updateMainviewsMenu(); + + if (event == EVT_KEY_BREAK(KEY_ENTER)) { + customScreens[menuPageCount-2] = registeredLayouts[0]->create(&g_model.screenData[menuPageCount-2].layoutData); + chainMenu(menuMainviews[menuPageCount-2]); + return false; + } + + MENU_WITH_OPTIONS("Add main view", LBM_MAINVIEWS_ICONS, menuTabMainviews, menuPageCount, menuPageCount-1, 0, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 }); + + return true; +} + +void onScreenSetupMenu(const char * result) +{ + if (result == STR_REMOVE_SCREEN) { + if (menuHorizontalPosition != MAX_CUSTOM_SCREENS-1) { + memmove(&g_model.screenData[menuHorizontalPosition], &g_model.screenData[menuHorizontalPosition + 1], sizeof(CustomScreenData) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1)); + memmove(&customScreens[menuHorizontalPosition], &customScreens[menuHorizontalPosition + 1], sizeof(Layout *) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1)); + } + memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData)); + customScreens[MAX_CUSTOM_SCREENS-1] = NULL; + chainMenu(menuMainviews[menuHorizontalPosition > 0 ? menuHorizontalPosition-1 : 0]); + } +} diff --git a/radio/src/gui/horus/theme.cpp b/radio/src/gui/horus/theme.cpp index 8f01958b1..9d3cb7763 100644 --- a/radio/src/gui/horus/theme.cpp +++ b/radio/src/gui/horus/theme.cpp @@ -40,3 +40,17 @@ const Theme * getTheme(const char * name) return NULL; } +void loadTheme(const Theme * new_theme) +{ + theme = new_theme; + theme->load(); +} + +void loadTheme() +{ + char name[sizeof(g_eeGeneral.themeName)+1]; + memset(name, 0, sizeof(name)); + strncpy(name, g_eeGeneral.themeName, sizeof(g_eeGeneral.themeName)); + const Theme * new_theme = getTheme(name); + loadTheme(new_theme ? new_theme : theme); +} \ No newline at end of file diff --git a/radio/src/gui/horus/theme.h b/radio/src/gui/horus/theme.h index b0b842d69..ca8421bca 100644 --- a/radio/src/gui/horus/theme.h +++ b/radio/src/gui/horus/theme.h @@ -61,6 +61,11 @@ extern const Theme * theme; #define MAX_REGISTERED_THEMES 10 extern unsigned int countRegisteredThemes; +void registerTheme(const Theme * theme); extern const Theme * registeredThemes[MAX_REGISTERED_THEMES]; // TODO dynamic +const Theme * getTheme(const char * name); +void loadTheme(const Theme * theme); +void loadTheme(); + #endif // _THEME_H_ diff --git a/radio/src/gui/horus/widgets.cpp b/radio/src/gui/horus/widgets.cpp index 8365229a1..131b4fb67 100644 --- a/radio/src/gui/horus/widgets.cpp +++ b/radio/src/gui/horus/widgets.cpp @@ -50,7 +50,7 @@ void drawTopbarDatetime() #define STICK_PANEL_WIDTH 68 void drawStick(coord_t x, coord_t y, int16_t xval, int16_t yval) { - lcdDrawBitmap(x, y, LBM_STICK_BACKGROUND); + lcdDrawAlphaBitmap(x, y, LBM_STICK_BACKGROUND); lcdDrawAlphaBitmap(x + 2 + STICK_PANEL_WIDTH/2 + STICK_PANEL_WIDTH/2 * xval/RESX, y + 2 + STICK_PANEL_WIDTH/2 - STICK_PANEL_WIDTH/2 * yval/RESX, LBM_STICK_POINTER); } @@ -426,7 +426,7 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int void drawSleepBitmap() { lcdClear(); - lcdDrawBitmap((LCD_W-SLEEP_BITMAP_WIDTH)/2, (LCD_H-SLEEP_BITMAP_HEIGHT)/2, LBM_SLEEP); + lcdDrawAlphaBitmap((LCD_W-SLEEP_BITMAP_WIDTH)/2, (LCD_H-SLEEP_BITMAP_HEIGHT)/2, LBM_SLEEP); lcdRefresh(); } diff --git a/radio/src/gui/taranis/lcd.cpp b/radio/src/gui/taranis/lcd.cpp index 1e20ee9ee..c3b134c5f 100644 --- a/radio/src/gui/taranis/lcd.cpp +++ b/radio/src/gui/taranis/lcd.cpp @@ -498,9 +498,9 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc } } -void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h) +void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att) { - lcdDrawVerticalLine(x, y, h, SOLID); + lcdDrawVerticalLine(x, y, h, SOLID, att); } #endif diff --git a/radio/src/gui/taranis/lcd.h b/radio/src/gui/taranis/lcd.h index 1f7262104..6711a247b 100644 --- a/radio/src/gui/taranis/lcd.h +++ b/radio/src/gui/taranis/lcd.h @@ -179,7 +179,7 @@ void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att=0); void lcdMaskPoint(uint8_t *p, uint8_t mask, LcdFlags att=0); void lcdDrawSolidHorizontalLine(coord_t x, coord_t y, coord_t w, LcdFlags att=0); void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att=0); -void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h); +void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att=0); void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att=0); void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0); void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0); diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index 2d5c1b5f4..2cf8a8c42 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -39,7 +39,7 @@ #include "opentx.h" #include "bin_allocator.h" #include "lua/lua_api.h" - + #if defined(LUA_COMPILER) && defined(SIMU) #include #include @@ -185,7 +185,12 @@ void luaRegisterAll() void luaInit() { + TRACE("luaInit"); + +#if !defined(COLORLCD) luaClose(); +#endif + if (luaState != INTERPRETER_PANIC) { #if defined(USE_BIN_ALLOCATOR) L = lua_newstate(bin_l_alloc, NULL); //we use our own allocator! @@ -212,6 +217,10 @@ void luaInit() luaDisable(); } } + +#if defined(COLORLCD) + luaLoadThemes(); +#endif } void luaFree(ScriptInternalData & sid) @@ -271,7 +280,7 @@ static void luaCompileAndSave(const char *bytecodeName) } #endif -int luaLoad(const char *filename, ScriptInternalData & sid, ScriptInputsOutputs * sio=NULL) +int luaLoad(const char * filename, ScriptInternalData & sid, ScriptInputsOutputs * sio=NULL) { int init = 0; @@ -301,7 +310,7 @@ int luaLoad(const char *filename, ScriptInternalData & sid, ScriptInputsOutputs luaL_checktype(L, -1, LUA_TTABLE); for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) { - const char *key = lua_tostring(L, -2); + const char * key = lua_tostring(L, -2); if (!strcmp(key, "init")) { init = luaL_ref(L, LUA_REGISTRYINDEX); lua_pushnil(L); @@ -529,9 +538,12 @@ void luaError(uint8_t error, bool acknowledge) } } -void luaExec(const char *filename) +void luaExec(const char * filename) { +#if !defined(COLORLCD) luaInit(); +#endif + if (luaState != INTERPRETER_PANIC) { standaloneScript.state = SCRIPT_NOFILE; int result = luaLoad(filename, standaloneScript); @@ -618,7 +630,7 @@ void luaDoOneRunStandalone(evt_t evt) } } } - + bool luaDoOneRunPermanentScript(uint8_t evt, int i, uint32_t scriptType) { ScriptInternalData & sid = scriptInternalData[i]; @@ -761,10 +773,12 @@ bool luaTask(uint8_t evt, uint8_t scriptType, bool allowLcdUsage) // run permanent scripts if (luaState & INTERPRETER_RELOAD_PERMANENT_SCRIPTS) { luaState = 0; +#if !defined(COLORLCD) luaInit(); if (luaState == INTERPRETER_PANIC) return false; luaLoadPermanentScripts(); if (luaState == INTERPRETER_PANIC) return false; +#endif } for (int i=0; iloadFunction = loadFunction; + theme->drawBackgroundFunction = drawBackgroundFunction; + theme->drawTopbarBackgroundFunction = drawTopbarBackgroundFunction; + } + } + else { + TRACE("Error in script %s: %s", filename, lua_tostring(L, -1)); + } + } + else { + luaDisable(); + return SCRIPT_PANIC; + } + UNPROTECT_LUA(); +} + +void luaLoadThemes() +{ + char path[THEME_FILENAME_MAXLEN+1] = THEMES_PATH; + FILINFO fno; + DIR dir; + char * fn; /* This function is assuming non-Unicode cfg. */ + TCHAR lfn[_MAX_LFN + 1]; + fno.lfname = lfn; + fno.lfsize = sizeof(lfn); + + FRESULT res = f_opendir(&dir, path); /* Open the directory */ + if (res == FR_OK) { + for (;;) { + res = f_readdir(&dir, &fno); /* Read a directory item */ + if (res != FR_OK || fno.fname[0] == 0) break; /* Break on error or end of dir */ + fn = * fno.lfname ? fno.lfname : fno.fname; + uint8_t len = strlen(fn); + bool found = false; + + // Eliminates directories / non wav files + if (len < 5 || strcasecmp(fn+len-4, SCRIPTS_EXT) || (fno.fattrib & AM_DIR)) continue; + path[sizeof(THEMES_PATH)-1] = '/'; + strcpy(path+sizeof(THEMES_PATH), fn); + luaLoadTheme(path); + } + } +} +#endif diff --git a/radio/src/lua/lua_api.h b/radio/src/lua/lua_api.h index 115f1f56e..5e93a3188 100644 --- a/radio/src/lua/lua_api.h +++ b/radio/src/lua/lua_api.h @@ -152,8 +152,11 @@ struct LuaField { char desc[50]; }; bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags=0); +void luaLoadThemes(); #else // defined(LUA) +#define luaInit() #define LUA_LOAD_MODEL_SCRIPTS() +#define luaLoadThemes() #endif // defined(LUA) #endif // _LUA_API_H_ diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index e548b9096..24bce8ee8 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -440,7 +440,8 @@ enum UartModes { char anaNames[NUM_STICKS+NUM_POTS][LEN_ANA_NAME]; \ char currModelFilename[LEN_MODEL_FILENAME+1]; \ uint8_t bluetoothEnable; \ - char bluetoothName[LEN_BLUETOOTH_NAME]; + char bluetoothName[LEN_BLUETOOTH_NAME]; \ + char themeName[8]; #elif defined(PCBFLAMENCO) #define LEN_SWITCH_NAME 3 #define LEN_ANA_NAME 3 diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 524d36000..42d9cd24f 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1880,24 +1880,6 @@ void doMixerCalculations() s_mixer_first_run_done = true; } -#if defined(COLORLCD) -void loadCustomScreens() -{ - for (unsigned int i=0; icreate(&g_model.screenData[0].layoutData); - } -} -#else - #define loadCustomScreens() -#endif - #if defined(NAVIGATION_STICKS) uint8_t StickScrollAllowed; uint8_t StickScrollTimer; @@ -1938,13 +1920,16 @@ void opentxStart() } #endif +#if defined(COLORLCD) + luaInit(); + loadTheme(); +#endif + #if defined(GUI) checkAlarm(); checkAll(); #endif - loadCustomScreens(); - #if defined(GUI) if (g_eeGeneral.chkSum != evalChkSum()) { chainMenu(menuFirstCalib); @@ -2601,10 +2586,6 @@ int main(void) lcdInit(); #endif -#if defined(COLORLCD) - theme->load(); -#endif - stackPaint(); #if defined(GUI) diff --git a/radio/src/sdcard.h b/radio/src/sdcard.h index 87dbd4429..047442fb6 100644 --- a/radio/src/sdcard.h +++ b/radio/src/sdcard.h @@ -2,7 +2,7 @@ * Copyright (C) OpenTX * * Based on code named - * th9x - http://code.google.com/p/th9x + * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * @@ -36,6 +36,7 @@ #define EEPROMS_PATH ROOT_PATH "EEPROMS" #define SCRIPTS_PATH ROOT_PATH "SCRIPTS" #define WIZARD_PATH SCRIPTS_PATH "/WIZARD" +#define THEMES_PATH SCRIPTS_PATH "/THEMES" #define WIZARD_NAME "wizard.lua" #define TEMPLATES_PATH SCRIPTS_PATH "/TEMPLATES" #define SCRIPTS_MIXES_PATH SCRIPTS_PATH "/MIXES" diff --git a/radio/src/storage/storage_common.cpp b/radio/src/storage/storage_common.cpp index 00a171bae..ee4b68a98 100644 --- a/radio/src/storage/storage_common.cpp +++ b/radio/src/storage/storage_common.cpp @@ -2,7 +2,7 @@ * Copyright (C) OpenTX * * Based on code named - * th9x - http://code.google.com/p/th9x + * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * @@ -87,9 +87,12 @@ void postModelLoad(bool newModel) referenceModelAudioFiles(); #endif +#if defined(COLORLCD) + loadCustomScreens(); +#endif + LOAD_MODEL_BITMAP(); LUA_LOAD_MODEL_SCRIPTS(); SEND_FAILSAFE_1S(); PLAY_MODEL_NAME(); } - diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index 5f566ee6d..4dcc55b90 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -2,7 +2,7 @@ * Copyright (C) OpenTX * * Based on code named - * th9x - http://code.google.com/p/th9x + * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * @@ -300,7 +300,7 @@ void *eeprom_write_function(void *) } eeprom_pointer++; eeprom_buffer_data++; - + if (fp && eeprom_buffer_size == 1) { fflush(fp); } @@ -326,14 +326,10 @@ void * main_thread(void *) try { #endif -#if defined(PCBHORUS) - theme->load(); -#endif - #if defined(CPUARM) stackPaint(); #endif - + s_current_protocol[0] = 255; menuLevel = 0; @@ -415,11 +411,11 @@ void StartMainThread(bool tests) #endif /* - g_tmr10ms must be non-zero otherwise some SF functions (that use this timer as a marker when it was last executed) + g_tmr10ms must be non-zero otherwise some SF functions (that use this timer as a marker when it was last executed) will be executed twice on startup. Normal radio does not see this issue because g_tmr10ms is already a big number before the first call to the Special Functions. Not so in the simulator. - There is another issue, some other function static variables depend on this value. If simulator is started + There is another issue, some other function static variables depend on this value. If simulator is started multiple times in one Companion session, they are set to their initial values only first time the simulator is started. Therefore g_tmr10ms must also be set to non-zero value only the first time, then it must be left alone to continue from the previous simulator session value. See the issue #2446 @@ -428,11 +424,11 @@ void StartMainThread(bool tests) if (g_tmr10ms == 0) { g_tmr10ms = 1; } - + #if defined(RTCLOCK) g_rtcTime = time(0); #endif - + main_thread_running = (tests ? 1 : 2); pthread_create(&main_thread_pid, NULL, &main_thread, NULL); } @@ -484,10 +480,10 @@ int32_t getVolume() #if defined(SIMU_AUDIO) && defined(CPUARM) -void copyBuffer(uint8_t * dest, uint16_t * buff, unsigned int samples) +void copyBuffer(uint8_t * dest, uint16_t * buff, unsigned int samples) { for(unsigned int i=0; id_name); fileMap.insert(filemap_t:: value_type(path, result)); simu::closedir(dir); - return result; + return result; } } } @@ -1047,7 +1043,7 @@ FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs) { // just fake that we always have some clusters free *nclst = 10; - return FR_OK; + return FR_OK; } #if defined(PCBSKY9X) @@ -1107,7 +1103,7 @@ void traceDiskStatus() { if (noDiskStatus > 0) { TRACE("disk_status() called %d times", noDiskStatus); - noDiskStatus = 0; + noDiskStatus = 0; } } @@ -1186,7 +1182,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff) DWORD noSectors = buf.st_size / 512; *(DWORD*)buff = noSectors; TRACE("disk_ioctl(GET_SECTOR_COUNT) = %u", noSectors); - return RES_OK; + return RES_OK; } return RES_ERROR; } diff --git a/radio/src/tests/lua.cpp b/radio/src/tests/lua.cpp index 906a9acf0..a0e3cad58 100644 --- a/radio/src/tests/lua.cpp +++ b/radio/src/tests/lua.cpp @@ -44,7 +44,6 @@ extern const char * zchar2string(const char * zstring, int size); #define EXPECT_ZSTREQ(c_string, z_string) EXPECT_STREQ(c_string, zchar2string(z_string, sizeof(z_string))) -extern void luaInit(); ::testing::AssertionResult __luaExecStr(const char * str) { diff --git a/radio/src/thirdparty/Lua/src/lrotable.c b/radio/src/thirdparty/Lua/src/lrotable.c index 93b418ab4..c188d9603 100644 --- a/radio/src/thirdparty/Lua/src/lrotable.c +++ b/radio/src/thirdparty/Lua/src/lrotable.c @@ -32,7 +32,7 @@ static luaR_result luaR_findkey(const void *where, const char *key, int type, in /* Find a global "read only table" in the constant lua_rotable array */ luaR_result luaR_findglobal(const char *name, lu_byte *ptype) { - unsigned i; + unsigned i; *ptype = LUA_TNIL; if (strlen(name) > LUA_MAX_ROTABLE_NAME) return 0; @@ -60,13 +60,13 @@ int luaR_findfunction(lua_State *L, const luaL_Reg *ptable) { lua_pushlightfunction(L, (void*)(size_t)res); else lua_pushnil(L); - return 1; + return 1; } luaR_result luaR_findentry(void *data, const char *key, lu_byte *ptype) { int found; unsigned idx = (unsigned)(size_t)data - 1; - luaR_result res; + luaR_result res; *ptype = LUA_TNIL; /* First look at the functions */ res = luaR_findkey(lua_rotable[idx].pfuncs, key, LUAR_FINDFUNCTION, &found); diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 0a5d861dc..894498c89 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -578,6 +578,7 @@ const pm_char STR_MODEL_SELECT[] PROGMEM = TR_MODEL_SELECT; const pm_char STR_SELECT_WIDGET[] PROGMEM = TR_SELECT_WIDGET; const pm_char STR_REMOVE_WIDGET[] PROGMEM = TR_REMOVE_WIDGET; const pm_char STR_WIDGET_SETTINGS[] PROGMEM = TR_WIDGET_SETTINGS; +const pm_char STR_REMOVE_SCREEN[] PROGMEM = TR_REMOVE_SCREEN; #endif #if defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS) diff --git a/radio/src/translations.h b/radio/src/translations.h index d8cc93467..4b63563cd 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -829,6 +829,7 @@ extern const pm_char STR_BLCOLOR[]; extern const pm_char STR_SELECT_WIDGET[]; extern const pm_char STR_REMOVE_WIDGET[]; extern const pm_char STR_WIDGET_SETTINGS[]; +extern const pm_char STR_REMOVE_SCREEN[]; #endif #if defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS) diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 77ca34cc8..034ad67b9 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -1102,6 +1102,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Vstupy" #define TR_MENU_LUA "\322Lua skripty" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 68639e5d6..b070d77ac 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -1105,6 +1105,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" // ----------------------------- Symbole für Auswahlliste---------- #define TR_MENU_INPUTS "\314Inputs" #define TR_MENU_LUA "\322Lua Scripte" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index e10c5a2fa..206019a9e 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -1131,6 +1131,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Inputs" #define TR_MENU_LUA "\322Lua scripts" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 0620b3db7..07ed9fa7c 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -1057,6 +1057,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Inputs" #define TR_MENU_LUA "\322Lua scripts" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 1c7a97c87..872c47228 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -1057,6 +1057,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Inputs" #define TR_MENU_LUA "\322Lua scripts" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index fa2f477fd..79c4baf56 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -1092,6 +1092,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Entrées" #define TR_MENU_LUA "\322Scripts Lua" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 9dc59f46d..c46f0b80c 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -1104,6 +1104,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Ingressi" #define TR_MENU_LUA "\322Lua scripts" diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index 6451aba44..c8b3f5eef 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -1123,6 +1123,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Inputs" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 66f7de1c2..f54c038cd 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -1105,6 +1105,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Wejści" #define TR_MENU_LUA "\322SkryptyLUA" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index ba16649a7..e8ae773a3 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -1051,6 +1051,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Inputs" #define TR_MENU_LUA "\322Lua scripts" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 553e23723..de92c3ab1 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -1128,6 +1128,7 @@ #define TR_SELECT_WIDGET "Select widget" #define TR_REMOVE_WIDGET "Remove widget" #define TR_WIDGET_SETTINGS "Widget settings" +#define TR_REMOVE_SCREEN "Remove screen" #define TR_MENU_INPUTS "\314Inputs" #define TR_MENU_LUA "\322Lua scripts"