diff --git a/radio/src/cli.cpp b/radio/src/cli.cpp index 212aad7f8..3a196e55b 100644 --- a/radio/src/cli.cpp +++ b/radio/src/cli.cpp @@ -401,6 +401,7 @@ int cliSet(const char ** argv) serialPrint("%s: Invalid arguments \"%s\" \"%s\"", argv[0], argv[1], argv[2]); } } +#if !defined(SOFTWARE_VOLUME) else if (!strcmp(argv[1], "volume")) { int level = 0; if (toInt(argv, 2, &level) > 0) { @@ -411,6 +412,7 @@ int cliSet(const char ** argv) } return 0; } +#endif return 0; } @@ -589,9 +591,11 @@ int cliDisplay(const char ** argv) gettime(&utm); serialPrint("rtc = %4d-%02d-%02d %02d:%02d:%02d.%02d0", utm.tm_year+TM_YEAR_BASE, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec, g_ms100); } +#if !defined(SOFTWARE_VOLUME) else if (!strcmp(argv[1], "volume")) { serialPrint("volume = %d", getVolume()); } +#endif #if defined(STM32) else if (!strcmp(argv[1], "uid")) { char str[LEN_CPU_UID+1]; diff --git a/radio/src/gui/128x64/gui.h b/radio/src/gui/128x64/gui.h index 4db87ea1e..10edcd092 100644 --- a/radio/src/gui/128x64/gui.h +++ b/radio/src/gui/128x64/gui.h @@ -404,6 +404,15 @@ void drawStatusLine(); #define EDIT_MODE_INIT -1 #endif +#if defined(VIRTUAL_INPUTS) +uint8_t getExposCount(); +void insertExpo(uint8_t idx); +void deleteExpo(uint8_t idx); +uint8_t getMixesCount(); +void insertMix(uint8_t idx); +void deleteMix(uint8_t idx); +#endif + typedef int (*FnFuncP) (int x); void drawFunction(FnFuncP fn, uint8_t offset=0); diff --git a/radio/src/gui/128x64/lcd.cpp b/radio/src/gui/128x64/lcd.cpp index e6621911f..46d6adeea 100644 --- a/radio/src/gui/128x64/lcd.cpp +++ b/radio/src/gui/128x64/lcd.cpp @@ -608,7 +608,7 @@ void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t l } else { // TODO needed on CPUAVR? y &= ~0x07; - lcdDrawFilledRect(xn, y+2*FH-3, ln, 2); + lcdDrawSolidFilledRect(xn, y+2*FH-3, ln, 2); } } if (neg) lcdDrawChar(x, y, '-', flags); @@ -665,6 +665,40 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc } #endif + +#if defined(CPUM64) +void lcdDrawVerticalLine(coord_t x, int8_t y, int8_t h, uint8_t pat) +{ + if (x >= LCD_W) return; + if (h<0) { y+=h; h=-h; } + if (y<0) { h+=y; y=0; } + if (y+h > LCD_H) { h = LCD_H - y; } + + if (pat==DOTTED && !(y%2)) + pat = ~pat; + + uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ]; + y = (y & 0x07); + if (y) { + ASSERT_IN_DISPLAY(p); + *p ^= ~(BITMASK(y)-1) & pat; + p += LCD_W; + h -= 8-y; + } + while (h>0) { + ASSERT_IN_DISPLAY(p); + *p ^= pat; + p += LCD_W; + h -= 8; + } + if (h < 0) h += 8; + if (h) { + p -= LCD_W; + ASSERT_IN_DISPLAY(p); + *p ^= ~(BITMASK(h)-1) & pat; + } +} + void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h) { lcdDrawVerticalLine(x, y, h, SOLID); @@ -678,6 +712,59 @@ void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFla lcdDrawHorizontalLine(x, y+h-1, w, pat); lcdDrawHorizontalLine(x, y, w, pat); } +#else +void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att) +{ + if (x >= LCD_W) return; +#if defined(CPUARM) + // should never happen on 9X + if (y >= LCD_H) return; +#endif + + if (h<0) { y+=h; h=-h; } + if (y<0) { h+=y; y=0; } + if (y+h > LCD_H) { h = LCD_H - y; } + + if (pat==DOTTED && !(y%2)) + pat = ~pat; + + uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ]; + y = (y & 0x07); + if (y) { + ASSERT_IN_DISPLAY(p); + uint8_t msk = ~(BITMASK(y)-1); + h -= 8-y; + if (h < 0) + msk -= ~(BITMASK(8+h)-1); + lcdMaskPoint(p, msk & pat, att); + p += LCD_W; + } + while (h>=8) { + ASSERT_IN_DISPLAY(p); + lcdMaskPoint(p, pat, att); + p += LCD_W; + h -= 8; + } + if (h>0) { + ASSERT_IN_DISPLAY(p); + lcdMaskPoint(p, (BITMASK(h)-1) & pat, att); + } +} + +void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att) +{ + lcdDrawVerticalLine(x, y, h, SOLID, att); +} + +void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att) +{ + lcdDrawVerticalLine(x, y, h, pat, att); + lcdDrawVerticalLine(x+w-1, y, h, pat, att); + if (~att & ROUND) { x+=1; w-=2; } + lcdDrawHorizontalLine(x, y+h-1, w, pat, att); + lcdDrawHorizontalLine(x, y, w, pat, att); +} +#endif #if !defined(BOOT) void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att) @@ -781,7 +868,7 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att) } else if (idx <= MIXSRC_LAST_INPUT) { lcdDrawChar(x+2, y+1, CHR_INPUT, TINSIZE); - lcdDrawFilledRect(x, y, 7, 7); + lcdDrawSolidFilledRect(x, y, 7, 7); if (ZEXIST(g_model.inputNames[idx-MIXSRC_FIRST_INPUT])) lcdDrawSizedText(x+8, y, g_model.inputNames[idx-MIXSRC_FIRST_INPUT], LEN_INPUT_NAME, ZCHAR|att); else @@ -1411,43 +1498,6 @@ void lcdDrawChar(coord_t x, uint8_t y, const unsigned char c, LcdFlags flags) } #endif -#if defined(CPUM64) -void lcdDrawVerticalLine(coord_t x, int8_t y, int8_t h, uint8_t pat) -{ - if (x >= LCD_W) return; - if (h<0) { y+=h; h=-h; } - if (y<0) { h+=y; y=0; } - if (y+h > LCD_H) { h = LCD_H - y; } - - if (pat==DOTTED && !(y%2)) - pat = ~pat; - - uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ]; - y = (y & 0x07); - if (y) { - ASSERT_IN_DISPLAY(p); - *p ^= ~(BITMASK(y)-1) & pat; - p += LCD_W; - h -= 8-y; - } - while (h>0) { - ASSERT_IN_DISPLAY(p); - *p ^= pat; - p += LCD_W; - h -= 8; - } - if (h < 0) h += 8; - if (h) { - p -= LCD_W; - ASSERT_IN_DISPLAY(p); - *p ^= ~(BITMASK(h)-1) & pat; - } -} -#else -// allows the att parameter... - -#endif - #define LCD_IMG_FUNCTION(NAME, TYPE, READ_BYTE) \ void NAME(coord_t x, coord_t y, TYPE img, uint8_t idx, LcdFlags att) \ { \ @@ -1523,44 +1573,6 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag } } -void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att) -{ - if (x >= LCD_W) return; -#if defined(CPUARM) - // should never happen on 9X - if (y >= LCD_H) return; -#endif - - if (h<0) { y+=h; h=-h; } - if (y<0) { h+=y; y=0; } - if (y+h > LCD_H) { h = LCD_H - y; } - - if (pat==DOTTED && !(y%2)) - pat = ~pat; - - uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ]; - y = (y & 0x07); - if (y) { - ASSERT_IN_DISPLAY(p); - uint8_t msk = ~(BITMASK(y)-1); - h -= 8-y; - if (h < 0) - msk -= ~(BITMASK(8+h)-1); - lcdMaskPoint(p, msk & pat, att); - p += LCD_W; - } - while (h>=8) { - ASSERT_IN_DISPLAY(p); - lcdMaskPoint(p, pat, att); - p += LCD_W; - h -= 8; - } - if (h>0) { - ASSERT_IN_DISPLAY(p); - lcdMaskPoint(p, (BITMASK(h)-1) & pat, att); - } -} - #if defined(PWR_PRESS_BUTTON) void drawShutdownAnimation(uint32_t index) { diff --git a/radio/src/gui/128x64/lcd.h b/radio/src/gui/128x64/lcd.h index 02ee5165e..783478e6f 100644 --- a/radio/src/gui/128x64/lcd.h +++ b/radio/src/gui/128x64/lcd.h @@ -226,10 +226,11 @@ 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); #if defined(CPUM64) + void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h); void lcdDrawVerticalLine(coord_t x, scoord_t y, int8_t h, uint8_t pat); #else + 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); #endif @@ -237,7 +238,11 @@ void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h); void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0); #endif -void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0); +void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att=0); +inline void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att=0) +{ + lcdDrawFilledRect(x, y, w, h, SOLID, att); +} void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0); void lcdInvertLine(int8_t line); diff --git a/radio/src/gui/128x64/model_inputs.cpp b/radio/src/gui/128x64/model_inputs.cpp index f967afba1..0f99bcb3c 100644 --- a/radio/src/gui/128x64/model_inputs.cpp +++ b/radio/src/gui/128x64/model_inputs.cpp @@ -540,7 +540,7 @@ void menuModelExposAll(event_t event) } if (cur == sub) { /* invert the raw when it's the current one */ - lcdDrawFilledRect(EXPO_LINE_SELECT_POS+1, y, LCD_W-EXPO_LINE_SELECT_POS-2, 7); + lcdDrawSolidFilledRect(EXPO_LINE_SELECT_POS+1, y, LCD_W-EXPO_LINE_SELECT_POS-2, 7); } } } diff --git a/radio/src/gui/128x64/model_inputs_mixes.cpp b/radio/src/gui/128x64/model_inputs_mixes.cpp index fb29cd31e..9097e1566 100644 --- a/radio/src/gui/128x64/model_inputs_mixes.cpp +++ b/radio/src/gui/128x64/model_inputs_mixes.cpp @@ -380,7 +380,7 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md) if (barMin <= barMax) { int8_t right = (barMax * GAUGE_WIDTH) / 200; int8_t left = ((barMin * GAUGE_WIDTH) / 200)-1; - lcdDrawFilledRect(x+GAUGE_WIDTH/2+left, y+2, right-left, GAUGE_HEIGHT-3); + lcdDrawSolidFilledRect(x+GAUGE_WIDTH/2+left, y+2, right-left, GAUGE_HEIGHT-3); } lcdDrawSolidVerticalLine(x+GAUGE_WIDTH/2-1, y, GAUGE_HEIGHT+1); if (barMin == -101) { @@ -882,7 +882,7 @@ void menuModelExpoMix(uint8_t expo, event_t event) } if (cur == sub) { /* invert the raw when it's the current one */ - lcdDrawFilledRect(expo ? EXPO_LINE_SELECT_POS+1 : 23, y, expo ? (LCD_W-EXPO_LINE_SELECT_POS-2) : (LCD_W-24), 7); + lcdDrawSolidFilledRect(expo ? EXPO_LINE_SELECT_POS+1 : 23, y, expo ? (LCD_W-EXPO_LINE_SELECT_POS-2) : (LCD_W-24), 7); } } } diff --git a/radio/src/gui/128x64/model_mixes.cpp b/radio/src/gui/128x64/model_mixes.cpp index 93827405d..ee02566da 100644 --- a/radio/src/gui/128x64/model_mixes.cpp +++ b/radio/src/gui/128x64/model_mixes.cpp @@ -178,7 +178,7 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md) if (barMin <= barMax) { int8_t right = (barMax * gaugeWidth) / 200; int8_t left = ((barMin * gaugeWidth) / 200)-1; - lcdDrawFilledRect(x+gaugeWidth/2+left, y+2, right-left, gaugeHeight-3); + lcdDrawSolidFilledRect(x+gaugeWidth/2+left, y+2, right-left, gaugeHeight-3); } lcdDrawSolidVerticalLine(x+gaugeWidth/2-1, y, gaugeHeight+1); if (barMin == -101) { @@ -569,7 +569,7 @@ void menuModelMixAll(event_t event) } if (cur == sub) { /* invert the raw when it's the current one */ - lcdDrawFilledRect(23, y, LCD_W-24, 7); + lcdDrawSolidFilledRect(23, y, LCD_W-24, 7); } } } diff --git a/radio/src/gui/128x64/model_select.cpp b/radio/src/gui/128x64/model_select.cpp index 395907b7c..36706c187 100644 --- a/radio/src/gui/128x64/model_select.cpp +++ b/radio/src/gui/128x64/model_select.cpp @@ -375,7 +375,7 @@ void menuModelSelect(event_t event) } if (s_copyMode && (vertpos_t)sub==i+menuVerticalOffset) { - lcdDrawFilledRect(9, y, MODELSEL_W-1-9, 7); + lcdDrawSolidFilledRect(9, y, MODELSEL_W-1-9, 7); lcdDrawRect(8, y-1, MODELSEL_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED); } } diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 12c348cff..89cc64af5 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -886,7 +886,7 @@ void menuModelSetup(event_t event) } } else { - lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN, y, LCD_W - MODEL_SETUP_2ND_COLUMN, 8); + lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN, y, LCD_W - MODEL_SETUP_2ND_COLUMN, 8); } } } diff --git a/radio/src/gui/128x64/popups.cpp b/radio/src/gui/128x64/popups.cpp index a9e6e8a8d..24e55f122 100644 --- a/radio/src/gui/128x64/popups.cpp +++ b/radio/src/gui/128x64/popups.cpp @@ -72,7 +72,7 @@ void drawAlertBox(const pm_char * title, const pm_char * text, const char * acti lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE); #endif - lcdDrawFilledRect(0, 0, LCD_W, 32); + lcdDrawSolidFilledRect(0, 0, LCD_W, 32); if (text) { lcdDrawTextAlignedLeft(5*FH, text); } @@ -150,7 +150,7 @@ const char * runPopupMenu(event_t event) for (uint8_t i=0; i display_count) { diff --git a/radio/src/gui/128x64/popups.h b/radio/src/gui/128x64/popups.h index 5f6def26a..038a5bc1c 100644 --- a/radio/src/gui/128x64/popups.h +++ b/radio/src/gui/128x64/popups.h @@ -32,6 +32,8 @@ void drawMessageBox(); void showMessageBox(const pm_char * title); void runPopupWarning(event_t event); +#define DRAW_MESSAGE_BOX(title) (warningText = title, drawMessageBox(), warningText = NULL) + #if defined(CPUARM) extern void (*popupFunc)(event_t event); extern int16_t warningInputValue; diff --git a/radio/src/gui/128x64/radio_sdmanager.cpp b/radio/src/gui/128x64/radio_sdmanager.cpp index 9e9f38464..0464d3085 100644 --- a/radio/src/gui/128x64/radio_sdmanager.cpp +++ b/radio/src/gui/128x64/radio_sdmanager.cpp @@ -56,6 +56,13 @@ inline bool isFilenameLower(bool isfile, const char * fn, const char * line) return (!isfile && line[SD_SCREEN_FILE_LENGTH+1]) || (isfile==(bool)line[SD_SCREEN_FILE_LENGTH+1] && strcasecmp(fn, line) < 0); } +void getSelectionFullPath(char * lfn) +{ + f_getcwd(lfn, _MAX_LFN); + strcat(lfn, PSTR("/")); + strcat(lfn, reusableBuffer.sdmanager.lines[menuVerticalPosition - HEADER_LINE - menuVerticalOffset]); +} + void onSdManagerMenu(const char * result) { TCHAR lfn[_MAX_LFN+1]; @@ -68,9 +75,7 @@ void onSdManagerMenu(const char * result) POPUP_CONFIRMATION(STR_CONFIRM_FORMAT); } else if (result == STR_DELETE_FILE) { - f_getcwd(lfn, _MAX_LFN); - strcat_P(lfn, PSTR("/")); - strcat(lfn, reusableBuffer.sdmanager.lines[index]); + getSelectionFullPath(lfn); f_unlink(lfn); strncpy(statusLineMsg, reusableBuffer.sdmanager.lines[index], 13); strcpy_P(statusLineMsg+min((uint8_t)strlen(statusLineMsg), (uint8_t)13), STR_REMOVED); @@ -80,19 +85,21 @@ void onSdManagerMenu(const char * result) } #if defined(CPUARM) /* TODO else if (result == STR_LOAD_FILE) { - f_getcwd(lfn, _MAX_LFN); - strcat(lfn, "/"); - strcat(lfn, reusableBuffer.sdmanager.lines[index]); + getSelectionFullPath(lfn); POPUP_WARNING(eeLoadModelSD(lfn)); } */ else if (result == STR_PLAY_FILE) { - f_getcwd(lfn, _MAX_LFN); - strcat(lfn, "/"); - strcat(lfn, reusableBuffer.sdmanager.lines[index]); + getSelectionFullPath(lfn); audioQueue.stopAll(); audioQueue.playFile(lfn, 0, ID_PLAY_FROM_SD_MANAGER); } #endif +#if defined(LUA) + else if (result == STR_EXECUTE_FILE) { + getSelectionFullPath(lfn); + luaExec(lfn); + } +#endif } void menuRadioSdManager(event_t _event) @@ -180,6 +187,11 @@ void menuRadioSdManager(event_t _event) else */ if (!strcasecmp(ext, SOUNDS_EXT)) { POPUP_MENU_ADD_ITEM(STR_PLAY_FILE); } +#endif +#if defined(LUA) + else if (!strcasecmp(ext, SCRIPTS_EXT)) { + POPUP_MENU_ADD_ITEM(STR_EXECUTE_FILE); + } #endif if (!READ_ONLY()) { POPUP_MENU_ADD_ITEM(STR_DELETE_FILE); diff --git a/radio/src/gui/128x64/view_main.cpp b/radio/src/gui/128x64/view_main.cpp index b5985ecac..0e9880c35 100644 --- a/radio/src/gui/128x64/view_main.cpp +++ b/radio/src/gui/128x64/view_main.cpp @@ -188,13 +188,13 @@ void displayBattVoltage() { #if defined(BATTGRAPH) putsVBat(VBATT_X-8, VBATT_Y+1, RIGHT); - lcdDrawFilledRect(VBATT_X-25, VBATT_Y+9, 21, 5); + lcdDrawSolidFilledRect(VBATT_X-25, VBATT_Y+9, 21, 5); lcdDrawSolidVerticalLine(VBATT_X-4, VBATT_Y+10, 3); uint8_t count = GET_TXBATT_BARS(); for (uint8_t i=0; i 1 && !defined(COLORLCD) /*luadoc @function GREY() @@ -1141,7 +1143,7 @@ const luaL_Reg opentxLib[] = { { "defaultChannel", luaDefaultChannel }, { "getRSSI", luaGetRSSI }, { "killEvents", luaKillEvents }, -#if !defined(COLORLCD) +#if LCD_DEPTH > 1 && !defined(COLORLCD) { "GREY", luaGrey }, #endif { "sportTelemetryPop", luaSportTelemetryPop }, @@ -1243,8 +1245,10 @@ const luaR_value_entry opentxConstants[] = { { "EVT_MINUS_FIRST", EVT_KEY_FIRST(KEY_MINUS) }, { "EVT_PLUS_REPT", EVT_KEY_REPT(KEY_PLUS) }, { "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS) }, +#if LCD_DEPTH > 1 { "FILL_WHITE", FILL_WHITE }, { "GREY_DEFAULT", GREY_DEFAULT }, +#endif { "FORCE", FORCE }, { "ERASE", ERASE }, { "ROUND", ROUND }, diff --git a/radio/src/lua/api_lcd.cpp b/radio/src/lua/api_lcd.cpp index d9c23ddfe..f7bc46846 100644 --- a/radio/src/lua/api_lcd.cpp +++ b/radio/src/lua/api_lcd.cpp @@ -423,7 +423,7 @@ static int luaLcdDrawBitmap(lua_State *L) return 0; } -#else +#elif LCD_DEPTH > 1 /*luadoc @function lcd.drawPixmap(x, y, name) @@ -555,7 +555,7 @@ static int luaLcdDrawGauge(lua_State *L) } -#if !defined(COLORLCD) +#if LCD_DEPTH > 1 && !defined(COLORLCD) /*luadoc @function lcd.drawScreenTitle(title, page, pages) @@ -587,7 +587,7 @@ static int luaLcdDrawScreenTitle(lua_State *L) } #endif -#if !defined(COLORLCD) +#if LCD_DEPTH > 1 && !defined(COLORLCD) /*luadoc @function lcd.drawCombobox(x, y, w, list, idx [, flags]) @@ -761,7 +761,7 @@ const luaL_Reg lcdLib[] = { { "drawBitmap", luaLcdDrawBitmap }, { "setColor", luaLcdSetColor }, { "RGB", luaRGB }, -#else +#elif LCD_DEPTH > 1 { "getLastPos", luaLcdGetLastPos }, { "drawPixmap", luaLcdDrawPixmap }, { "drawScreenTitle", luaLcdDrawScreenTitle }, diff --git a/radio/src/lua/api_model.cpp b/radio/src/lua/api_model.cpp index 4b175d483..c98aaf47f 100644 --- a/radio/src/lua/api_model.cpp +++ b/radio/src/lua/api_model.cpp @@ -39,7 +39,9 @@ static int luaModelGetInfo(lua_State *L) { lua_newtable(L); lua_pushtablezstring(L, "name", g_model.header.name); +#if LCD_DEPTH > 1 lua_pushtablenzstring(L, "bitmap", g_model.header.bitmap); +#endif return 1; } @@ -68,10 +70,12 @@ static int luaModelSetInfo(lua_State *L) memcpy(modelHeaders[g_eeGeneral.currModel].name, g_model.header.name, sizeof(g_model.header.name)); #endif } +#if LCD_DEPTH > 1 else if (!strcmp(key, "bitmap")) { const char * name = luaL_checkstring(L, -1); strncpy(g_model.header.bitmap, name, sizeof(g_model.header.bitmap)); } +#endif } storageDirty(EE_MODEL); return 0; diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index 926ffaa1d..e33a82024 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -426,7 +426,7 @@ void luaLoadPermanentScripts() void displayLuaError(const char * title) { #if !defined(COLORLCD) - drawMessageBox(title); + DRAW_MESSAGE_BOX(title); #endif if (lua_warning_info[0]) { char * split = strstr(lua_warning_info, ": "); diff --git a/radio/src/targets/taranis/CMakeLists.txt b/radio/src/targets/taranis/CMakeLists.txt index cb121fcc6..f3765bba4 100644 --- a/radio/src/targets/taranis/CMakeLists.txt +++ b/radio/src/targets/taranis/CMakeLists.txt @@ -7,7 +7,7 @@ if(PCB STREQUAL X9E) set(CPU_TYPE STM32F4) set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld) set(HAPTIC YES) - set(LUA_EXPORT lua_export_taranis_x9e) + set(LUA_EXPORT lua_export_x9e) set(FLAVOUR x9e) add_definitions(-DSTM32F40_41xxx -DPCBX9E) add_definitions(-DEEPROM_VARIANT=32768) @@ -29,7 +29,7 @@ elseif(PCB STREQUAL X9D+) set(CPU_TYPE STM32F2) set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld) set(HAPTIC YES) - set(LUA_EXPORT lua_export_taranis) + set(LUA_EXPORT lua_export_x9d) set(FLAVOUR x9d+) add_definitions(-DPCBX9DP) add_definitions(-DEEPROM_VARIANT=0) @@ -42,7 +42,7 @@ elseif(PCB STREQUAL X9D) set(CPU_TYPE STM32F2) set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld) option(HAPTIC "Haptic support" OFF) - set(LUA_EXPORT lua_export_taranis) + set(LUA_EXPORT lua_export_x9d) set(FLAVOUR x9d) add_definitions(-DPCBX9D) add_definitions(-DEEPROM_VARIANT=0) @@ -55,7 +55,7 @@ elseif(PCB STREQUAL X7D) set(CPU_TYPE STM32F2) set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld) set(HAPTIC YES) - set(LUA_EXPORT lua_export_taranis) + set(LUA_EXPORT lua_export_x7d) set(FLAVOUR x7d) add_definitions(-DPCBX7D -DSOFTWARE_VOLUME) add_definitions(-DEEPROM_VARIANT=0) diff --git a/radio/src/targets/taranis/bootloader/boot.cpp b/radio/src/targets/taranis/bootloader/boot.cpp index 8b1c91cd5..1ebdc5df2 100644 --- a/radio/src/targets/taranis/bootloader/boot.cpp +++ b/radio/src/targets/taranis/bootloader/boot.cpp @@ -552,7 +552,7 @@ int main() progress = (200*eepromWritten) / EEPROM_SIZE; } - lcdDrawRect( 3, 6*FH+4, 204, 7); + lcdDrawRect(3, 6*FH+4, 204, 7); lcdDrawSolidHorizontalLine(5, 6*FH+6, progress, FORCE); lcdDrawSolidHorizontalLine(5, 6*FH+7, progress, FORCE); lcdDrawSolidHorizontalLine(5, 6*FH+8, progress, FORCE);