diff --git a/radio/src/bitmaps/horus/shutdown.png b/radio/src/bitmaps/horus/shutdown.png new file mode 100644 index 000000000..8f3307020 Binary files /dev/null and b/radio/src/bitmaps/horus/shutdown.png differ diff --git a/radio/src/bitmaps/horus/sleep.png b/radio/src/bitmaps/horus/sleep.png new file mode 100644 index 000000000..b35df3e52 Binary files /dev/null and b/radio/src/bitmaps/horus/sleep.png differ diff --git a/radio/src/gui/9x/gui.h b/radio/src/gui/9x/gui.h index 48555f20b..d92323ad1 100644 --- a/radio/src/gui/9x/gui.h +++ b/radio/src/gui/9x/gui.h @@ -38,8 +38,8 @@ extern const pm_uchar sticks[] PROGMEM; #define MIXES_2ND_COLUMN (12*FW) #endif -void displaySplash(); -void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr); +void drawSplash(); +void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr); void drawStick(coord_t centrex, int16_t xval, int16_t yval); #if !defined(CPUM64) diff --git a/radio/src/gui/9x/menu_model_select.cpp b/radio/src/gui/9x/menu_model_select.cpp index 8d9b27e3b..be86ac80c 100644 --- a/radio/src/gui/9x/menu_model_select.cpp +++ b/radio/src/gui/9x/menu_model_select.cpp @@ -309,9 +309,9 @@ void menuModelSelect(uint8_t event) #endif #if defined(ROTARY_ENCODER_NAVIGATION) - displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_RE_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0); + drawScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_RE_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0); #else - displayScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0); + drawScreenIndex(e_ModelSelect, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0); #endif TITLE(STR_MENUMODELSEL); diff --git a/radio/src/gui/9x/navigation.cpp b/radio/src/gui/9x/navigation.cpp index 5a7f05e67..23516b334 100644 --- a/radio/src/gui/9x/navigation.cpp +++ b/radio/src/gui/9x/navigation.cpp @@ -435,7 +435,7 @@ void check(check_event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, ui } calibrationState = 0; - displayScreenIndex(curr, menuTabSize, attr); + drawScreenIndex(curr, menuTabSize, attr); } diff --git a/radio/src/gui/9x/splash.cpp b/radio/src/gui/9x/splash.cpp index 8ef18dda7..ecf185f1b 100644 --- a/radio/src/gui/9x/splash.cpp +++ b/radio/src/gui/9x/splash.cpp @@ -27,7 +27,7 @@ const pm_uchar splashdata[] PROGMEM = { 'S','P','E',0 }; const pm_uchar * const splash_lbm = splashdata+4; -void displaySplash() +void drawSplash() { lcdClear(); lcd_img(0, 0, splash_lbm, 0, 0); diff --git a/radio/src/gui/9x/view_mavlink.cpp b/radio/src/gui/9x/view_mavlink.cpp index 552a25ce8..a7fd6e46a 100644 --- a/radio/src/gui/9x/view_mavlink.cpp +++ b/radio/src/gui/9x/view_mavlink.cpp @@ -182,7 +182,7 @@ void mav_title(const pm_char * s, uint8_t index) { lcdDrawText(0, 0, PSTR("MAVLINK"), INVERS); lcdDrawText(10 * FW, 0, s); - displayScreenIndex(index, MAX_MAVLINK_MENU, INVERS); + drawScreenIndex(index, MAX_MAVLINK_MENU, INVERS); lcdDrawChar(7 * FW, 0, (mav_heartbeat > 0) ? '*' : ' '); if (telemetry_data.active) lcdDrawChar(8 * FW, 0, 'A', BLINK); diff --git a/radio/src/gui/9x/view_mavlink.h b/radio/src/gui/9x/view_mavlink.h index 31c12aa45..ff4e511ca 100644 --- a/radio/src/gui/9x/view_mavlink.h +++ b/radio/src/gui/9x/view_mavlink.h @@ -33,7 +33,7 @@ #define APSIZE (BSS | DBLSIZE) void menuTelemetryMavlink(uint8_t event); -void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr); +void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr); void lcd_outdezFloat(uint8_t x, uint8_t y, float val, uint8_t precis, uint8_t mode = 0); void mav_title(const pm_char * s, uint8_t index); void menuTelemetryMavlinkInfos(void); diff --git a/radio/src/gui/9x/widgets.cpp b/radio/src/gui/9x/widgets.cpp index ece0e59c7..6f1d24517 100644 --- a/radio/src/gui/9x/widgets.cpp +++ b/radio/src/gui/9x/widgets.cpp @@ -47,7 +47,7 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr) #endif } -void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr) +void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr) { lcdDrawNumber(LCD_W, 0, count, attr); coord_t x = 1+LCD_W-FW*(count>9 ? 3 : 2); diff --git a/radio/src/gui/horus/bitmaps.cpp b/radio/src/gui/horus/bitmaps.cpp index be6bb9ada..86f511979 100644 --- a/radio/src/gui/horus/bitmaps.cpp +++ b/radio/src/gui/horus/bitmaps.cpp @@ -251,3 +251,11 @@ const uint8_t LBM_CURVE_POINT_CENTER[] = { const uint8_t LBM_CURVE_COORD_SHADOW[] = { #include "mask_coord_shadow.lbm" }; +/* +const uint8_t LBM_SHUTDOWN[] = { +#include "shutdown.lbm" +}; + +const uint8_t LBM_SLEEP[] = { +#include "sleep.lbm" +}; */ \ No newline at end of file diff --git a/radio/src/gui/horus/gui.h b/radio/src/gui/horus/gui.h index 67f12d256..355263f69 100644 --- a/radio/src/gui/horus/gui.h +++ b/radio/src/gui/horus/gui.h @@ -63,8 +63,8 @@ extern uint8_t modelBitmap[MODEL_BITMAP_SIZE]; bool loadModelBitmap(char * name, uint8_t * bitmap); #define LOAD_MODEL_BITMAP() loadModelBitmap(g_model.header.bitmap, modelBitmap) -void displaySplash(); -void displayScreenIndex(uint8_t index, uint8_t count); +void drawSplash(); +void drawScreenIndex(uint8_t index, uint8_t count); void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible); void drawHorizontalScrollbar(coord_t x, coord_t y, coord_t w, uint16_t offset, uint16_t count, uint8_t visible); void drawHeader(int index); @@ -124,3 +124,5 @@ extern const uint8_t LBM_POINT[]; extern const uint8_t LBM_CURVE_POINT[]; extern const uint8_t LBM_CURVE_POINT_CENTER[]; extern const uint8_t LBM_CURVE_COORD_SHADOW[]; +extern const uint8_t LBM_SHUTDOWN[]; +extern const uint8_t LBM_SLEEP[]; diff --git a/radio/src/gui/horus/lcd.cpp b/radio/src/gui/horus/lcd.cpp index 0f176d1a5..d82f15b7c 100644 --- a/radio/src/gui/horus/lcd.cpp +++ b/radio/src/gui/horus/lcd.cpp @@ -450,6 +450,12 @@ void putsStrIdx(coord_t x, coord_t y, const pm_char *str, int idx, LcdFlags att, lcdDrawText(x, y, s, att); } +void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att) +{ + uint8_t length = STR_VSRCRAW[0]; + lcdDrawSizedText(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att); +} + void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att) { if (idx == MIXSRC_NONE) { diff --git a/radio/src/gui/horus/lcd.h b/radio/src/gui/horus/lcd.h index 5ddd35e94..abc7b6eeb 100644 --- a/radio/src/gui/horus/lcd.h +++ b/radio/src/gui/horus/lcd.h @@ -181,6 +181,7 @@ void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags flags=0, uint8_t void putsStrIdx(coord_t x, coord_t y, const pm_char *str, int idx, LcdFlags att=0, const char *prefix=""); void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att); +void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0); void putsSwitches(coord_t x, coord_t y, int8_t swtch, LcdFlags att=0); void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0); void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att=0); @@ -211,7 +212,6 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att=0); #define PIXEL_PTR(x, y) &displayBuf[(y)*LCD_W + (x)] - inline void lcdDrawPixel(display_t * p, display_t value) { *p = value; @@ -313,6 +313,8 @@ void lcdSetContrast(); const char * bmpLoad(uint8_t * dest, const char * filename, uint16_t width, uint16_t height); const char * imgLoad(uint8_t * dest, const char * filename, uint16_t width, uint16_t height); +void drawSleepBitmap(); +void drawShutdownBitmap(uint8_t index); #if defined(BOOT) #define BLINK_ON_PHASE (0) diff --git a/radio/src/gui/horus/menu_general_calib.cpp b/radio/src/gui/horus/menu_general_calib.cpp index 58eddc14e..6e3040c9f 100644 --- a/radio/src/gui/horus/menu_general_calib.cpp +++ b/radio/src/gui/horus/menu_general_calib.cpp @@ -20,22 +20,25 @@ #include "../../opentx.h" -#define XPOT_DELTA 10 -#define XPOT_DELAY 10 /* cycles */ - -#define BAR_HEIGHT (BOX_WIDTH-9) -#define LBOX_CENTERX (BOX_WIDTH/2 + 17) -#define RBOX_CENTERX (LCD_W-LBOX_CENTERX) +#define XPOT_DELTA 10 +#define XPOT_DELAY 10 /* cycles */ +#define BAR_WIDTH 7 +#define BAR_HEIGHT (BOX_WIDTH-9) +#define BAR_INTERVAL 20 +#define BAR_BOTTOM 200 +#define LBOX_CENTERX (BOX_WIDTH/2 + 17) +#define RBOX_CENTERX (LCD_W-LBOX_CENTERX) void drawPotsBars() { // Optimization by Mike Blandford unsigned int x, i, len ; // declare temporary variables - for (x=LCD_W/2-9, i=NUM_STICKS; i 50) { @@ -151,7 +150,6 @@ bool menuCommonCalib(evt_t event) break; case 3: -#if 0 for (int i=POT1; i<=POT_LAST; i++) { int idx = i - POT1; int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount; @@ -171,28 +169,26 @@ bool menuCommonCalib(evt_t event) } } else { - g_eeGeneral.potsType &= ~(0x03<<(2*idx)); + g_eeGeneral.potsConfig &= ~(0x03<<(2*idx)); } } } -#endif g_eeGeneral.chkSum = evalChkSum(); storageDirty(EE_GENERAL); - reusableBuffer.calib.state = 4; + calibrationState = 4; break; default: - reusableBuffer.calib.state = 0; + calibrationState = 0; break; } drawSticksPositions(); drawPotsBars(); -#if 0 for (int i=POT1; i<=POT_LAST; i++) { uint8_t steps = 0; - if (reusableBuffer.calib.state == 2) { + if (calibrationState == 2) { steps = reusableBuffer.calib.xpotsCalib[i-POT1].stepsCount; } else if (IS_POT_MULTIPOS(i)) { @@ -200,10 +196,9 @@ bool menuCommonCalib(evt_t event) steps = calib->count + 1; } if (steps > 0 && steps <= XPOTS_MULTIPOS_COUNT) { - lcdDrawNumber(LCD_W/2-2+(i-POT1)*5, LCD_H-6, steps, TINSIZE); + lcdDrawNumber(LCD_W/2-(BAR_INTERVAL*NUM_POTS/2)+(BAR_INTERVAL*(i-POT1)), BAR_BOTTOM+15, steps, TEXT_COLOR|TINSIZE, 0, "[", "]"); } } -#endif return true; } @@ -211,19 +206,14 @@ bool menuCommonCalib(evt_t event) bool menuGeneralCalib(evt_t event) { SIMPLE_MENU(STR_MENUCALIBRATION, menuTabGeneral, e_Calib, 0, DEFAULT_SCROLLBAR_X); - menuVerticalPosition = -1; - if (menuEvent) { - calibrationState = 0; - } - return menuCommonCalib(READ_ONLY() ? 0 : event); } bool menuFirstCalib(evt_t event) { - if (event == EVT_KEY_BREAK(KEY_EXIT) || reusableBuffer.calib.state == 4) { + if (event == EVT_KEY_BREAK(KEY_EXIT) || calibrationState == 4) { calibrationState = 0; chainMenu(menuMainView); return false; diff --git a/radio/src/gui/horus/navigation.cpp b/radio/src/gui/horus/navigation.cpp index e2415ad1d..5e55c2972 100644 --- a/radio/src/gui/horus/navigation.cpp +++ b/radio/src/gui/horus/navigation.cpp @@ -368,7 +368,7 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u } #endif } - else { + else if (!calibrationState) { popMenu(); } break; diff --git a/radio/src/gui/horus/splash.cpp b/radio/src/gui/horus/splash.cpp index df03d78d5..67af57c2e 100644 --- a/radio/src/gui/horus/splash.cpp +++ b/radio/src/gui/horus/splash.cpp @@ -25,7 +25,7 @@ const uint8_t LBM_SPLASH[] = { }; #if defined(SPLASH) -void displaySplash() +void drawSplash() { lcdClear(); diff --git a/radio/src/gui/horus/widgets.cpp b/radio/src/gui/horus/widgets.cpp index 94b1028ab..8ab2b8e9f 100644 --- a/radio/src/gui/horus/widgets.cpp +++ b/radio/src/gui/horus/widgets.cpp @@ -323,3 +323,17 @@ int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t m return value; } #endif + +void drawSleepBitmap() +{ +/* lcdClear(); + lcdDrawBitmap(POPUP_X-80, POPUP_Y-30, LBM_SLEEP); + lcdRefresh(); */ +} + +void drawShutdownBitmap(uint8_t index) +{ + /*lcdClear(); + lcdDrawBitmap(76, 2, LBM_SHUTDOWN, index * 60, 60); + lcdRefresh();*/ +} diff --git a/radio/src/gui/taranis/gui.h b/radio/src/gui/taranis/gui.h index 06e52fcce..d22ca0756 100644 --- a/radio/src/gui/taranis/gui.h +++ b/radio/src/gui/taranis/gui.h @@ -55,8 +55,8 @@ struct MenuItem { }; int circularIncDec(int current, int inc, int min, int max, IsValueAvailable isValueAvailable=NULL); -void displaySplash(); -void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr); +void drawSplash(); +void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr); void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible); void displayMenuBar(const MenuItem *menu, int index); void drawProgressBar(const char *label); diff --git a/radio/src/gui/taranis/lcd.cpp b/radio/src/gui/taranis/lcd.cpp index acfdfcd5d..c159e8042 100644 --- a/radio/src/gui/taranis/lcd.cpp +++ b/radio/src/gui/taranis/lcd.cpp @@ -1108,7 +1108,7 @@ void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags a } } -void lcd_bmp(coord_t x, coord_t y, const uint8_t * img, coord_t offset, coord_t width) +void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset, coord_t width) { const uint8_t *q = img; uint8_t w = *q++; diff --git a/radio/src/gui/taranis/lcd.h b/radio/src/gui/taranis/lcd.h index 118577e1c..d6ac16340 100644 --- a/radio/src/gui/taranis/lcd.h +++ b/radio/src/gui/taranis/lcd.h @@ -188,13 +188,16 @@ inline void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, 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); +inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) +{ + lcdDrawRect(x, y, w, w, SOLID, att); +} void lcdInvertLine(int8_t line); #define lcdInvertLastLine() lcdInvertLine(LCD_LINES-1) -inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcdDrawRect(x, y, w, w, SOLID, att); } - -void displaySleepBitmap(); +void drawShutdownBitmap(uint8_t index); +void drawSleepBitmap(); void lcdDrawTelemetryTopBar(); #define V_BAR(xx, yy, ll) \ @@ -204,8 +207,8 @@ void lcdDrawTelemetryTopBar(); void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0); -void lcd_bmp(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0); -#define LCD_ICON(x, y, icon) lcd_bmp(x, y, icons, icon) +void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0); +#define LCD_ICON(x, y, icon) lcdDrawBitmap(x, y, icons, icon) void lcdSetRefVolt(unsigned char val); void lcdClear(); diff --git a/radio/src/gui/taranis/menu_general_calib.cpp b/radio/src/gui/taranis/menu_general_calib.cpp index 8955ff28a..c1f375ddb 100644 --- a/radio/src/gui/taranis/menu_general_calib.cpp +++ b/radio/src/gui/taranis/menu_general_calib.cpp @@ -81,8 +81,7 @@ void menuCommonCalib(uint8_t event) calibrationState = reusableBuffer.calib.state; // make sure we don't scroll while calibrating - switch (event) - { + switch (event) { case EVT_ENTRY: case EVT_KEY_BREAK(KEY_EXIT): reusableBuffer.calib.state = 0; diff --git a/radio/src/gui/taranis/menu_general_sdmanager.cpp b/radio/src/gui/taranis/menu_general_sdmanager.cpp index dfe60495b..584053a79 100644 --- a/radio/src/gui/taranis/menu_general_sdmanager.cpp +++ b/radio/src/gui/taranis/menu_general_sdmanager.cpp @@ -462,6 +462,6 @@ void menuGeneralSdManager(evt_t _event) memcpy(modelBitmap, logo_taranis, MODEL_BITMAP_SIZE); } } - lcd_bmp(22*FW+2, 2*FH+FH/2, modelBitmap); + lcdDrawBitmap(22*FW+2, 2*FH+FH/2, modelBitmap); } } diff --git a/radio/src/gui/taranis/menu_model_select.cpp b/radio/src/gui/taranis/menu_model_select.cpp index b6ec57401..dbc2eadea 100644 --- a/radio/src/gui/taranis/menu_model_select.cpp +++ b/radio/src/gui/taranis/menu_model_select.cpp @@ -224,7 +224,7 @@ void menuModelSelect(uint8_t event) lcdDrawNumber(20*FW, 0, EeFsGetFree(), 0); lcdDrawText(21*FW, 0, STR_BYTES); - displayScreenIndex(e_ModelSelect, DIM(menuTabModel), 0); + drawScreenIndex(e_ModelSelect, DIM(menuTabModel), 0); lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT); TITLE(STR_MENUMODELSEL); @@ -270,5 +270,5 @@ void menuModelSelect(uint8_t event) loadModelBitmap(modelHeaders[sub].bitmap, modelBitmap); } - lcd_bmp(22*FW+2, 2*FH+FH/2, modelBitmap); + lcdDrawBitmap(22*FW+2, 2*FH+FH/2, modelBitmap); } diff --git a/radio/src/gui/taranis/navigation.cpp b/radio/src/gui/taranis/navigation.cpp index 28ff84758..86cd496b5 100644 --- a/radio/src/gui/taranis/navigation.cpp +++ b/radio/src/gui/taranis/navigation.cpp @@ -394,7 +394,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuHandle } if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) { - displayScreenIndex(curr, menuTabSize, 0); + drawScreenIndex(curr, menuTabSize, 0); } lcdDrawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT); diff --git a/radio/src/gui/taranis/popups.cpp b/radio/src/gui/taranis/popups.cpp index 6cc864378..9c3bf3ab1 100644 --- a/radio/src/gui/taranis/popups.cpp +++ b/radio/src/gui/taranis/popups.cpp @@ -58,7 +58,7 @@ const pm_uchar asterisk_lbm[] PROGMEM = { void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SOUND_ARG) { lcdClear(); - lcd_bmp(0, 0, asterisk_lbm); + lcdDrawBitmap(0, 0, asterisk_lbm); #define MESSAGE_LCD_OFFSET 60 diff --git a/radio/src/gui/taranis/splash.cpp b/radio/src/gui/taranis/splash.cpp index a1ef897a5..0a5ce7990 100644 --- a/radio/src/gui/taranis/splash.cpp +++ b/radio/src/gui/taranis/splash.cpp @@ -27,10 +27,10 @@ const pm_uchar splashdata[] PROGMEM = { 'S','P','E',0 }; const pm_uchar * const splash_lbm = splashdata+4; -void displaySplash() +void drawSplash() { lcdClear(); - lcd_bmp(0, 0, splash_lbm); + lcdDrawBitmap(0, 0, splash_lbm); #if MENUS_LOCK == 1 if (readonly == false) { diff --git a/radio/src/gui/taranis/view_about.cpp b/radio/src/gui/taranis/view_about.cpp index 51af33026..221dbde37 100644 --- a/radio/src/gui/taranis/view_about.cpp +++ b/radio/src/gui/taranis/view_about.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "../../opentx.h" const pm_uchar about_bmp[] PROGMEM = { @@ -66,7 +66,7 @@ void menuAboutView(uint8_t event) break; } - lcd_bmp(0, 0, about_bmp); + lcdDrawBitmap(0, 0, about_bmp); lcdDrawText(64, 0, STR_ABOUTUS, DBLSIZE); lcdDrawSolidHorizontalLine(ABOUT_X, 18, 120); lcdDrawSolidHorizontalLine(ABOUT_X, 19, 130, GREY_DEFAULT); diff --git a/radio/src/gui/taranis/view_main.cpp b/radio/src/gui/taranis/view_main.cpp index 26fbaf39b..c76623d0c 100644 --- a/radio/src/gui/taranis/view_main.cpp +++ b/radio/src/gui/taranis/view_main.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "../../opentx.h" #include "../../timers.h" @@ -198,7 +198,7 @@ void displayTopBarGauge(coord_t x, int count, bool blinking=false) } #define LCD_NOTIF_ICON(x, icon) \ - lcd_bmp(x, BAR_Y, icons, icon); \ + lcdDrawBitmap(x, BAR_Y, icons, icon); \ lcdDrawSolidHorizontalLine(x, BAR_Y+8, 11) void displayTopBar() @@ -513,7 +513,7 @@ void menuMainView(uint8_t event) // Sliders (Pots / Sliders) drawSliders(); - lcd_bmp(BITMAP_X, BITMAP_Y, modelBitmap); + lcdDrawBitmap(BITMAP_X, BITMAP_Y, modelBitmap); // Switches if (getSwitchCount() > 8) { diff --git a/radio/src/gui/taranis/widgets.cpp b/radio/src/gui/taranis/widgets.cpp index 968e4d248..605fc1f7f 100644 --- a/radio/src/gui/taranis/widgets.cpp +++ b/radio/src/gui/taranis/widgets.cpp @@ -24,10 +24,21 @@ const pm_uchar bmp_sleep[] PROGMEM = { #include "../../bitmaps/taranis/sleep.lbm" }; -void displaySleepBitmap() +void drawSleepBitmap() { lcdClear(); - lcd_bmp(76, 2, bmp_sleep, 0, 60); + lcdDrawBitmap(76, 2, bmp_sleep, 0, 60); + lcdRefresh(); +} + +const pm_uchar bmp_shutdown[] PROGMEM = { + #include "../../bitmaps/taranis/shutdown.lbm" +}; + +void drawShutdownBitmap(uint8_t index) +{ + lcdClear(); + lcdDrawBitmap(76, 2, bmp_shutdown, index * 60, 60); lcdRefresh(); } @@ -58,7 +69,7 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr) lcdDrawSquare(x, y, 7); } -void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr) +void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr) { lcdDrawNumber(LCD_W, 0, count, attr); coord_t x = 1+LCD_W-FW*(count>9 ? 3 : 2); diff --git a/radio/src/lua/api_lcd.cpp b/radio/src/lua/api_lcd.cpp index 85665a47e..68aa7a8d5 100644 --- a/radio/src/lua/api_lcd.cpp +++ b/radio/src/lua/api_lcd.cpp @@ -343,7 +343,7 @@ static int luaLcdDrawPixmap(lua_State *L) uint8_t bitmap[BITMAP_BUFFER_SIZE(LCD_W/2, LCD_H)]; // width max is LCD_W/2 pixels for saving stack and avoid a malloc here const pm_char * error = bmpLoad(bitmap, filename, LCD_W/2, LCD_H); if (!error) { - lcd_bmp(x, y, bitmap); + lcdDrawBitmap(x, y, bitmap); } return 0; } @@ -464,7 +464,7 @@ static int luaLcdDrawScreenTitle(lua_State *L) int idx = luaL_checkinteger(L, 2); int cnt = luaL_checkinteger(L, 3); - if (cnt) displayScreenIndex(idx-1, cnt, 0); + if (cnt) drawScreenIndex(idx-1, cnt, 0); lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT); title(str); diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 970ad524a..7f0339ec7 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -391,7 +391,7 @@ enum BeeperMode { int8_t backgroundVolume; #endif -#if defined(PCBTARANIS) +#if defined(PCBTARANIS) || defined(PCBHORUS) #if defined(REV9E) #define swconfig_t uint64_t #define swarnstate_t uint64_t @@ -427,10 +427,10 @@ enum UartModes { #define EXTRA_GENERAL_FIELDS \ EXTRA_GENERAL_FIELDS_ARM \ uint8_t serial2Mode:6; \ - uint8_t spare:2; \ + uint8_t slidersConfig:2; \ CustomFunctionData customFn[NUM_CFN]; \ uint32_t switchConfig; \ - uint8_t potsType; /*two bits for every pot*/\ + uint8_t potsConfig; /* two bits per pot */ \ char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \ char anaNames[NUM_STICKS+NUM_POTS][LEN_ANA_NAME]; \ char currModelFilename[LEN_MODEL_FILENAME+1]; @@ -463,7 +463,7 @@ enum UartModes { EXTRA_GENERAL_FIELDS_ARM \ uint8_t serial2Mode:6; \ uint8_t slidersConfig:2; \ - uint8_t potsConfig; /*two bits for every pot*/\ + uint8_t potsConfig; /* two bits per pot */\ uint8_t backlightColor; \ swarnstate_t switchUnlockStates; \ CustomFunctionData customFn[NUM_CFN]; \ @@ -1926,15 +1926,15 @@ enum MixSources { MIXSRC_FIRST_POT, #if defined(PCBHORUS) - MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1") - MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2") - MIXSRC_POT3, LUA_EXPORT("s3", "Potentiometer 3") + MIXSRC_S1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer S1") + MIXSRC_6POS, LUA_EXPORT("6pos", "Multipos Switch") + MIXSRC_S2, LUA_EXPORT("s2", "Potentiometer S2") MIXSRC_FIRST_SLIDER, - MIXSRC_SLIDER1 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider") - MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider") - MIXSRC_SLIDER3, LUA_EXPORT("lcs", "Left center slider") - MIXSRC_SLIDER4, LUA_EXPORT("rcs", "Right center slider") - MIXSRC_LAST_POT = MIXSRC_SLIDER4, + MIXSRC_S3 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("s3", "Slider S3") + MIXSRC_S4, LUA_EXPORT("s4", "Slider S4") + MIXSRC_LS, LUA_EXPORT("ls", "Left rear slider") + MIXSRC_RS, LUA_EXPORT("rs", "Right rear slider") + MIXSRC_LAST_POT = MIXSRC_RS, #elif defined(PCBFLAMENCO) MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("sd", "Potentiometer D") MIXSRC_SLIDER1, LUA_EXPORT("ls", "Left slider") diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index c1aeebca6..317070816 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "opentx.h" #include "timers.h" @@ -244,12 +244,15 @@ void generalDefault() g_eeGeneral.vBatWarn = 33; g_eeGeneral.vBatMin = -60; // 0 is 9.0V g_eeGeneral.vBatMax = -78; // 0 is 12.0V +#elif defined(PCBHORUS) + g_eeGeneral.potsConfig = 0x05; // S1 and S2 = pots with detent + g_eeGeneral.slidersConfig = 0x03; // LS and RS = sliders with detent #elif defined(PCBTARANIS) g_eeGeneral.potsConfig = 0x05; // S1 and S2 = pots with detent g_eeGeneral.slidersConfig = 0x03; // LS and RS = sliders with detent #endif -#if defined(PCBTARANIS) +#if defined(PCBTARANIS) || defined(PCBHORUS) g_eeGeneral.switchConfig = 0x00007bff; // 6x3POS, 1x2POS, 1xTOGGLE #endif @@ -368,7 +371,7 @@ void applyDefaultTemplate() #endif for (int i=0; idestCh = i; mix->weight = 100; #if defined(VIRTUALINPUTS) @@ -989,12 +992,12 @@ bool readonlyUnlocked() #if defined(SPLASH) void doSplash() { -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) bool refresh = false; #endif if (SPLASH_NEEDED()) { - displaySplash(); + drawSplash(); #if !defined(CPUARM) AUDIO_TADA(); @@ -1038,7 +1041,7 @@ void doSplash() } #endif -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) uint32_t pwr_check = pwrCheck(); if (pwr_check == e_power_off) { break; @@ -1047,7 +1050,7 @@ void doSplash() refresh = true; } else if (pwr_check == e_power_on && refresh) { - displaySplash(); + drawSplash(); refresh = false; } #else @@ -1197,7 +1200,7 @@ void checkTHR() // first - display warning; also deletes inputs if any have been before MESSAGE(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP, AU_THROTTLE_ALERT); -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) bool refresh = false; #endif @@ -1211,7 +1214,7 @@ void checkTHR() v = calibratedStick[thrchn]; -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) uint32_t pwr_check = pwrCheck(); if (pwr_check == e_power_off) { break; @@ -1255,7 +1258,7 @@ void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG) { MESSAGE(t, s, STR_PRESSANYKEY, sound); -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) bool refresh = false; #endif @@ -1269,7 +1272,7 @@ void alert(const pm_char * t, const pm_char *s MESSAGE_SOUND_ARG) wdt_reset(); -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) uint32_t pwr_check = pwrCheck(); if (pwr_check == e_power_off) { boardOff(); @@ -2515,7 +2518,7 @@ int main(void) #endif #if defined(PCBTARANIS) - displaySplash(); + drawSplash(); #endif sei(); // interrupts needed now @@ -2592,13 +2595,9 @@ int main(void) } #endif // !SIMU -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) #define PWR_PRESS_SHUTDOWN 300 // 3s -const pm_uchar bmp_shutdown[] PROGMEM = { - #include "../../bitmaps/taranis/shutdown.lbm" -}; - uint32_t pwr_press_time = 0; uint32_t pwrPressedDuration() @@ -2660,9 +2659,7 @@ uint32_t pwrCheck() else { lcdRefreshWait(); unsigned index = pwrPressedDuration() / (PWR_PRESS_SHUTDOWN / 4); - lcdClear(); - lcd_bmp(76, 2, bmp_shutdown, index*60, 60); - lcdRefresh(); + drawShutdownBitmap(index); return e_power_press; } } diff --git a/radio/src/opentx.h b/radio/src/opentx.h index cb7d89b7b..e8db7933a 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -352,12 +352,12 @@ #if defined(PCBHORUS) #define IS_POT_AVAILABLE(x) (true) - #define IS_POT_MULTIPOS(x) (x==0) - #define IS_POT_WITHOUT_DETENT(x) (x==0) + #define IS_POT_MULTIPOS(x) ((x)==POT2) + #define IS_POT_WITHOUT_DETENT(x) (true) #elif defined(PCBFLAMENCO) #define IS_POT_AVAILABLE(x) (true) - #define IS_POT_MULTIPOS(x) (x==0) - #define IS_POT_WITHOUT_DETENT(x) (x==0) + #define IS_POT_MULTIPOS(x) (false) + #define IS_POT_WITHOUT_DETENT(x) (false) #elif defined(PCBTARANIS) && defined(REV9E) #define IS_SLIDER_AVAILABLE(x) ((x)==SLIDER1 || (x)==SLIDER2 || (g_eeGeneral.slidersConfig & (0x01 << ((x)-SLIDER3)))) #define IS_POT_AVAILABLE(x) ((x)=SLIDER1 && IS_SLIDER_AVAILABLE(x))) @@ -377,10 +377,14 @@ #define IS_POT_WITHOUT_DETENT(x) (true) #endif -#define IS_POT(x) ((x)>=POT1 && (x)<=POT_LAST) +#define IS_POT(x) ((x)>=POT1 && (x)<=POT_LAST) -#define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4) -#define SAVE_POT_POSITION(i) g_model.potsWarnPosition[i] = GET_LOWRES_POT_POSITION(i) +#if defined(PCBFLAMENCO) || defined(PCBHORUS) || (defined(PCBTARANIS) && defined(REV9E)) + #define PWR_BUTTON_DELAY +#endif + +#define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4) +#define SAVE_POT_POSITION(i) g_model.potsWarnPosition[i] = GET_LOWRES_POT_POSITION(i) #if ROTARY_ENCODERS > 0 #define IF_ROTARY_ENCODERS(x) x, diff --git a/radio/src/targets/horus/adc_driver.cpp b/radio/src/targets/horus/adc_driver.cpp index e9d1c1518..08a018d88 100644 --- a/radio/src/targets/horus/adc_driver.cpp +++ b/radio/src/targets/horus/adc_driver.cpp @@ -130,14 +130,14 @@ void adcInit() #define SPI_STICK2 1 #define SPI_STICK3 2 #define SPI_STICK4 3 -#define SPI_POT1 4 -#define SPI_POT2 5 -#define SPI_POT3 6 -#define SPI_SLIDER1 7 -#define SPI_SLIDER2 8 +#define SPI_S1 4 +#define SPI_6POS 5 +#define SPI_S2 6 +#define SPI_S3 7 +#define SPI_S4 8 #define SPI_TX_VOLTAGE 9 -#define SPI_SLIDER3 10 -#define SPI_SLIDER4 11 +#define SPI_RS 10 +#define SPI_LS 11 const uint16_t adcCommands[MOUSE1+2] = { @@ -145,13 +145,13 @@ const uint16_t adcCommands[MOUSE1+2] = MANUAL_MODE | ( SPI_STICK2 << 7 ), MANUAL_MODE | ( SPI_STICK3 << 7 ), MANUAL_MODE | ( SPI_STICK4 << 7 ), - MANUAL_MODE | ( SPI_POT1 << 7 ), - MANUAL_MODE | ( SPI_POT2 << 7 ), - MANUAL_MODE | ( SPI_POT3 << 7 ), - MANUAL_MODE | ( SPI_SLIDER1 << 7 ), - MANUAL_MODE | ( SPI_SLIDER2 << 7 ), - MANUAL_MODE | ( SPI_SLIDER4 << 7 ), - MANUAL_MODE | ( SPI_SLIDER3 << 7 ), + MANUAL_MODE | ( SPI_S1 << 7 ), + MANUAL_MODE | ( SPI_6POS << 7 ), + MANUAL_MODE | ( SPI_S2 << 7 ), + MANUAL_MODE | ( SPI_LS << 7 ), + MANUAL_MODE | ( SPI_RS << 7 ), + MANUAL_MODE | ( SPI_S3 << 7 ), + MANUAL_MODE | ( SPI_S4 << 7 ), MANUAL_MODE | ( SPI_TX_VOLTAGE << 7 ), MANUAL_MODE | ( 0 << 7 ), MANUAL_MODE | ( 0 << 7 ) @@ -199,7 +199,7 @@ void adcRead() // On chip ADC read should have finished } -const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1, 1,1, -1,-1, 0,0,0}; +const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1, -1,-1, 1,1, 0,0,0}; uint16_t getAnalogValue(uint32_t index) { diff --git a/radio/src/targets/horus/board_horus.cpp b/radio/src/targets/horus/board_horus.cpp index 6ffa2c77c..780648be9 100644 --- a/radio/src/targets/horus/board_horus.cpp +++ b/radio/src/targets/horus/board_horus.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "../../opentx.h" #if defined(__cplusplus) && !defined(SIMU) diff --git a/radio/src/targets/horus/hal.h b/radio/src/targets/horus/hal.h index 4892d38f4..82e461f03 100644 --- a/radio/src/targets/horus/hal.h +++ b/radio/src/targets/horus/hal.h @@ -1,25 +1,25 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef _HAL_H_ -#define _HAL_H_ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _HAL_H_ +#define _HAL_H_ // Keys #define KEYS_RCC_AHB1Periph_GPIO (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_GPIOG | RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOI | RCC_AHB1Periph_GPIOJ) @@ -44,18 +44,18 @@ #define ENC_GPIO_PIN_B GPIO_Pin_10 // PH.10 // Switches -#define SWITCHES_GPIO_REG_A_H GPIOI->IDR -#define SWITCHES_GPIO_PIN_A_H GPIO_Pin_15 // PI.15 -#define SWITCHES_GPIO_REG_A_L GPIOH->IDR -#define SWITCHES_GPIO_PIN_A_L GPIO_Pin_9 // PH.09 +#define SWITCHES_GPIO_REG_A_H GPIOH->IDR +#define SWITCHES_GPIO_PIN_A_H GPIO_Pin_9 // PH.09 +#define SWITCHES_GPIO_REG_A_L GPIOI->IDR +#define SWITCHES_GPIO_PIN_A_L GPIO_Pin_15 // PI.15 #define SWITCHES_GPIO_REG_B_H GPIOH->IDR #define SWITCHES_GPIO_PIN_B_H GPIO_Pin_12 // PH.12 #define SWITCHES_GPIO_REG_B_L GPIOB->IDR #define SWITCHES_GPIO_PIN_B_L GPIO_Pin_12 // PB.12 -#define SWITCHES_GPIO_REG_C_H GPIOB->IDR -#define SWITCHES_GPIO_PIN_C_H GPIO_Pin_15 // PB.15 -#define SWITCHES_GPIO_REG_C_L GPIOD->IDR -#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_11 // PD.11 +#define SWITCHES_GPIO_REG_C_H GPIOD->IDR +#define SWITCHES_GPIO_PIN_C_H GPIO_Pin_11 // PD.11 +#define SWITCHES_GPIO_REG_C_L GPIOB->IDR +#define SWITCHES_GPIO_PIN_C_L GPIO_Pin_15 // PB.15 #define SWITCHES_GPIO_REG_D_H GPIOJ->IDR #define SWITCHES_GPIO_PIN_D_H GPIO_Pin_7 // PJ.07 #define SWITCHES_GPIO_REG_D_L GPIOG->IDR @@ -67,9 +67,9 @@ #define SWITCHES_GPIO_REG_F GPIOH->IDR #define SWITCHES_GPIO_PIN_F GPIO_Pin_3 // PH.03 #define SWITCHES_GPIO_REG_G_H GPIOG->IDR -#define SWITCHES_GPIO_PIN_G_H GPIO_Pin_3 // PG.03 +#define SWITCHES_GPIO_PIN_G_H GPIO_Pin_6 // PG.06 #define SWITCHES_GPIO_REG_G_L GPIOG->IDR -#define SWITCHES_GPIO_PIN_G_L GPIO_Pin_6 // PG.06 +#define SWITCHES_GPIO_PIN_G_L GPIO_Pin_3 // PG.03 #define SWITCHES_GPIO_REG_H GPIOG->IDR #define SWITCHES_GPIO_PIN_H GPIO_Pin_7 // PG.07 @@ -100,13 +100,13 @@ #define TRIMS_GPIO_PIN_LSU GPIO_Pin_13 // PB.13 // Index of all keys -#define KEYS_GPIOB_PINS (SWITCHES_GPIO_PIN_B_L | SWITCHES_GPIO_PIN_C_H | TRIMS_GPIO_PIN_LSD | TRIMS_GPIO_PIN_LSU) +#define KEYS_GPIOB_PINS (SWITCHES_GPIO_PIN_B_L | SWITCHES_GPIO_PIN_C_L | TRIMS_GPIO_PIN_LSD | TRIMS_GPIO_PIN_LSU) #define KEYS_GPIOC_PINS (KEYS_GPIO_PIN_MENU | KEYS_GPIO_PIN_ENTER | KEYS_GPIO_PIN_RIGHT | TRIMS_GPIO_PIN_RHL) -#define KEYS_GPIOD_PINS (SWITCHES_GPIO_PIN_C_L | TRIMS_GPIO_PIN_LHL | TRIMS_GPIO_PIN_LHR | TRIMS_GPIO_PIN_RSU) +#define KEYS_GPIOD_PINS (SWITCHES_GPIO_PIN_C_H | TRIMS_GPIO_PIN_LHL | TRIMS_GPIO_PIN_LHR | TRIMS_GPIO_PIN_RSU) #define KEYS_GPIOE_PINS (SWITCHES_GPIO_PIN_E_L) #define KEYS_GPIOG_PINS (KEYS_GPIO_PIN_UP | SWITCHES_GPIO_PIN_D_L | SWITCHES_GPIO_PIN_G_H | SWITCHES_GPIO_PIN_G_L | SWITCHES_GPIO_PIN_H | TRIMS_GPIO_PIN_RVD) -#define KEYS_GPIOH_PINS (SWITCHES_GPIO_PIN_A_L | SWITCHES_GPIO_PIN_B_H | SWITCHES_GPIO_PIN_E_H | SWITCHES_GPIO_PIN_F | ENC_GPIO_PIN_A | ENC_GPIO_PIN_B) -#define KEYS_GPIOI_PINS (KEYS_GPIO_PIN_EXIT | KEYS_GPIO_PIN_LEFT | KEYS_GPIO_PIN_DOWN | SWITCHES_GPIO_PIN_A_H | TRIMS_GPIO_PIN_RHR) +#define KEYS_GPIOH_PINS (SWITCHES_GPIO_PIN_A_H | SWITCHES_GPIO_PIN_B_H | SWITCHES_GPIO_PIN_E_H | SWITCHES_GPIO_PIN_F | ENC_GPIO_PIN_A | ENC_GPIO_PIN_B) +#define KEYS_GPIOI_PINS (KEYS_GPIO_PIN_EXIT | KEYS_GPIO_PIN_LEFT | KEYS_GPIO_PIN_DOWN | SWITCHES_GPIO_PIN_A_L | TRIMS_GPIO_PIN_RHR) #define KEYS_GPIOJ_PINS (SWITCHES_GPIO_PIN_D_H | TRIMS_GPIO_PIN_RVU | TRIMS_GPIO_PIN_LVD | TRIMS_GPIO_PIN_LVU | TRIMS_GPIO_PIN_RSD) // ADC @@ -130,8 +130,8 @@ // Power #define PWR_RCC_AHB1Periph RCC_AHB1Periph_GPIOJ #define PWR_GPIO GPIOJ -#define PWR_GPIO_PIN_ON GPIO_Pin_0 // PJ.00 -#define PWR_GPIO_PIN_SWITCH GPIO_Pin_1 // PJ.01 +#define PWR_GPIO_PIN_ON GPIO_Pin_1 // PJ.01 +#define PWR_GPIO_PIN_SWITCH GPIO_Pin_0 // PJ.00 // Led #define LED_RCC_AHB1Periph RCC_AHB1Periph_GPIOI @@ -269,4 +269,4 @@ #define TIMER_2MHz_APB1Periph RCC_APB1Periph_TIM7 #define TIMER_2MHz_TIMER TIM7 -#endif // _HAL_H_ +#endif // _HAL_H_ diff --git a/radio/src/targets/horus/keys_driver.cpp b/radio/src/targets/horus/keys_driver.cpp index 8f631b494..2c40ee6a5 100644 --- a/radio/src/targets/horus/keys_driver.cpp +++ b/radio/src/targets/horus/keys_driver.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "../../opentx.h" uint32_t readKeys() @@ -147,6 +147,13 @@ void readKeysAndTrims() case SW_S ## x ## 2: \ xxx = ~SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \ break +#define ADD_NEG_2POS_CASE(x) \ + case SW_S ## x ## 2: \ + xxx = SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \ + break; \ + case SW_S ## x ## 0: \ + xxx = ~SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \ + break #define ADD_3POS_CASE(x, i) \ case SW_S ## x ## 0: \ xxx = (SWITCHES_GPIO_REG_ ## x ## _H & SWITCHES_GPIO_PIN_ ## x ## _H); \ @@ -177,7 +184,7 @@ bool switchState(EnumKeys enuk) ADD_3POS_CASE(C, 2); ADD_3POS_CASE(D, 3); ADD_3POS_CASE(E, 4); - ADD_2POS_CASE(F); + ADD_NEG_2POS_CASE(F); ADD_3POS_CASE(G, 6); ADD_2POS_CASE(H); default: diff --git a/radio/src/targets/horus/pwr_driver.c b/radio/src/targets/horus/pwr_driver.c index b7af9f2bd..20e50ddb9 100644 --- a/radio/src/targets/horus/pwr_driver.c +++ b/radio/src/targets/horus/pwr_driver.c @@ -1,34 +1,29 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "../../pwr.h" #include "../horus/board_horus.h" -extern volatile uint32_t g_tmr10ms; -#define get_tmr10ms() g_tmr10ms - void pwrInit() { GPIO_InitTypeDef GPIO_InitStructure; - - /* GPIO Configuration*/ GPIO_InitStructure.GPIO_Pin = PWR_GPIO_PIN_ON; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; @@ -38,25 +33,20 @@ void pwrInit() GPIO_InitStructure.GPIO_Pin = PWR_GPIO_PIN_SWITCH; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; - GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; - GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_Init(PWR_GPIO, &GPIO_InitStructure); - // Soft power ON - GPIO_SetBits(PWR_GPIO, PWR_GPIO_PIN_ON); - // Init Module PWR GPIO_ResetBits(EXTMODULE_GPIO_PWR, EXTMODULE_GPIO_PIN_PWR); GPIO_InitStructure.GPIO_Pin = EXTMODULE_GPIO_PIN_PWR; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; - GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; - GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(EXTMODULE_GPIO_PWR, &GPIO_InitStructure); - // TODO while (pwrPressed()) ; + pwrOn(); +} +void pwrOn() +{ + GPIO_SetBits(PWR_GPIO, PWR_GPIO_PIN_ON); } void pwrOff() @@ -68,33 +58,3 @@ uint32_t pwrPressed() { return GPIO_ReadInputDataBit(PWR_GPIO, PWR_GPIO_PIN_SWITCH) == Bit_RESET; } - -#if !defined(BOOT) -uint32_t pwrPressTime = 0; -uint32_t pwrPressedDuration() -{ - if (pwrPressTime == 0) { - return 0; - } - else { - return get_tmr10ms() - pwrPressTime; - } -} -uint32_t pwrCheck() -{ - if (pwrPressed()) { - if (pwrPressTime == 0) { - pwrPressTime = get_tmr10ms(); - } - else { - if (get_tmr10ms() - pwrPressTime > 250) { - return e_power_off; - } - } - } - else { - pwrPressTime = 0; - } - return e_power_on; -} -#endif diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index fd6e2e65d..4c5bd833b 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -1279,14 +1279,15 @@ int lcdRestoreBackupBuffer() } #endif -#if defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS) -void pwrInit() { } -void pwrOff() { } -#if defined(REV9E) +#if defined(PWR_BUTTON_DELAY) uint32_t pwrPressed() { return false; } #else uint32_t pwrCheck() { return true; } #endif + +#if defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS) +void pwrInit() { } +void pwrOff() { } int usbPlugged() { return false; } void USART_DeInit(USART_TypeDef* ) { } ErrorStatus RTC_SetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct) { return SUCCESS; } diff --git a/radio/src/targets/taranis/board_taranis.cpp b/radio/src/targets/taranis/board_taranis.cpp index 2e2f534e1..1147fbad3 100644 --- a/radio/src/targets/taranis/board_taranis.cpp +++ b/radio/src/targets/taranis/board_taranis.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "../../opentx.h" #if defined(__cplusplus) && !defined(SIMU) @@ -146,7 +146,7 @@ void boardInit() #if defined(REV9E) if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) { lcdClear(); - lcd_bmp(76, 2, bmp_lock, 0, 60); + lcdDrawBitmap(76, 2, bmp_lock, 0, 60); lcdRefresh(); lcdRefreshWait(); @@ -158,10 +158,10 @@ void boardInit() if (duration < PWR_PRESS_DURATION_MIN) { unsigned index = duration / (PWR_PRESS_DURATION_MIN / 4); lcdClear(); - lcd_bmp(76, 2, bmp_startup, index*60, 60); + lcdDrawBitmap(76, 2, bmp_startup, index*60, 60); } else if (duration >= PWR_PRESS_DURATION_MAX) { - displaySleepBitmap(); + drawSleepBitmap(); turnBacklightOff(); } else { diff --git a/radio/src/tasks_arm.cpp b/radio/src/tasks_arm.cpp index 129126a60..1fa164752 100644 --- a/radio/src/tasks_arm.cpp +++ b/radio/src/tasks_arm.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "opentx.h" OS_TID menusTaskId; @@ -129,7 +129,7 @@ void menusTask(void * pdata) { opentxInit(); -#if defined(PCBTARANIS) && defined(REV9E) +#if defined(PWR_BUTTON_DELAY) while (1) { uint32_t pwr_check = pwrCheck(); if (pwr_check == e_power_off) { @@ -158,9 +158,8 @@ void menusTask(void * pdata) BACKLIGHT_OFF(); -#if defined(COLORLCD) -#elif defined(PCBTARANIS) - displaySleepBitmap(); +#if defined(COLORLCD) || defined(PCBTARANIS) + drawSleepBitmap(); #else lcdClear(); displayPopup(STR_SHUTDOWN); diff --git a/radio/src/tests/lcd.cpp b/radio/src/tests/lcd.cpp index 45115e7d9..77c595ab9 100644 --- a/radio/src/tests/lcd.cpp +++ b/radio/src/tests/lcd.cpp @@ -297,10 +297,10 @@ TEST(Lcd, BMPWrapping) lcdClear(); uint8_t bitmap[2+40*40/2]; bmpLoad(bitmap, "./tests/plane.bmp", 40, 40); - lcd_bmp(200, 0, bitmap); - lcd_bmp(200, 60, bitmap); - lcd_bmp(240, 60, bitmap); // x too big - lcd_bmp(20, 200, bitmap); // y too big + lcdDrawBitmap(200, 0, bitmap); + lcdDrawBitmap(200, 60, bitmap); + lcdDrawBitmap(240, 60, bitmap); // x too big + lcdDrawBitmap(20, 200, bitmap); // y too big EXPECT_TRUE(checkScreenshot("bmpwrapping")); } #endif @@ -359,7 +359,7 @@ public: }; #if defined(PCBTARANIS) -TEST(Lcd, lcd_bmpLoadAndDisplay) +TEST(Lcd, lcdDrawBitmapLoadAndDisplay) { lcdClear(); // Test proper BMP files, they should display correctly @@ -367,33 +367,33 @@ TEST(Lcd, lcd_bmpLoadAndDisplay) TestBuffer<1000> bitmap(BITMAP_BUFFER_SIZE(7, 32)); EXPECT_EQ(bmpLoad(bitmap.buffer(), "./tests/4b_7x32.bmp", 7, 32), (char *)0); bitmap.leakCheck(); - lcd_bmp(10, 2, bitmap.buffer()); + lcdDrawBitmap(10, 2, bitmap.buffer()); } { TestBuffer<1000> bitmap(BITMAP_BUFFER_SIZE(6, 32)); EXPECT_EQ(bmpLoad(bitmap.buffer(), "./tests/1b_6x32.bmp", 6, 32), (char *)0); bitmap.leakCheck(); - lcd_bmp(20, 2, bitmap.buffer()); + lcdDrawBitmap(20, 2, bitmap.buffer()); } { TestBuffer<1000> bitmap(BITMAP_BUFFER_SIZE(31, 31)); EXPECT_EQ(bmpLoad(bitmap.buffer(), "./tests/4b_31x31.bmp", 31, 31), (char *)0); bitmap.leakCheck(); - lcd_bmp(30, 2, bitmap.buffer()); + lcdDrawBitmap(30, 2, bitmap.buffer()); } { TestBuffer<1000> bitmap(BITMAP_BUFFER_SIZE(39, 32)); EXPECT_EQ(bmpLoad(bitmap.buffer(), "./tests/1b_39x32.bmp", 39, 32), (char *)0); bitmap.leakCheck(); - lcd_bmp(70, 2, bitmap.buffer()); + lcdDrawBitmap(70, 2, bitmap.buffer()); } { TestBuffer<1000> bitmap(BITMAP_BUFFER_SIZE(20, 20)); EXPECT_EQ(bmpLoad(bitmap.buffer(), "./tests/4b_20x20.bmp", 20, 20), (char *)0); bitmap.leakCheck(); - lcd_bmp(120, 2, bitmap.buffer()); + lcdDrawBitmap(120, 2, bitmap.buffer()); } - EXPECT_TRUE(checkScreenshot("lcd_bmpLoadAndDisplay")); + EXPECT_TRUE(checkScreenshot("lcdDrawBitmapLoadAndDisplay")); // Test various bad BMP files, they should not display { diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 67b01644c..3bfbf4c1b 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -469,7 +469,7 @@ #define TR_TRIMS_VSRCRAW TR("TrmR""TrmE""TrmT""TrmA", "\313Rud""\313Ele""\313Thr""\313Ail") #if defined(PCBHORUS) - #define TR_POTS_VSRCRAW "\310F1\0""\310F2\0""\310F3\0""\311S1\0""\311S2\0""\311LS\0""\311RS\0" + #define TR_POTS_VSRCRAW "\310S1\0""\3106P\0""\310S2\0""\311S3\0""\311S4\0""\311LS\0""\311RS\0" #define TR_SW_VSRCRAW "\312SA\0""\312SB\0""\312SC\0""\312SD\0""\312SE\0""\312SF\0""\312SG\0""\312SH\0" #elif defined(PCBFLAMENCO) #define TR_POTS_VSRCRAW "SD\0 ""LS\0 ""RS\0 " @@ -597,7 +597,6 @@ #define OFS_EXIT sizeof(TR_ENTER) #endif -#define TR_MENUWHENDONE CENTER "\006" TR_ENTER " WHEN DONE" #define TR_FREE "free" #define TR_DELETEMODEL "DELETE" BREAKSPACE "MODEL" #define TR_COPYINGMODEL "Copying model..." @@ -729,10 +728,12 @@ #define TR_MENUTOSTART TR_ENTER " TO START" #define TR_SETMIDPOINT "CENTER STICKS/SLIDERS" #define TR_MOVESTICKSPOTS "MOVE STICKS/POTS" + #define TR_MENUWHENDONE TR_ENTER " WHEN DONE" #else #define TR_MENUTOSTART CENTER "\010" TR_ENTER " TO START" #define TR_SETMIDPOINT TR(CENTER "\004SET STICKS MIDPOINT", CENTER "\004CENTER STICKS/SLIDERS") #define TR_MOVESTICKSPOTS CENTER "\006MOVE STICKS/POTS" + #define TR_MENUWHENDONE CENTER "\006" TR_ENTER " WHEN DONE" #endif #define TR_RXBATT "Rx Batt:" #define TR_TXnRX "Tx:\0Rx:"