[all] New german translations

[all except '64] Trainer short and Trainer long in Custom Functions
[Taranis] No Haptic function
[Taranis] Overflow problem in playValue
[Taranis] EEPROM flushed and loaded again before / after USB connection
This commit is contained in:
bsongis@gmail.com
2013-04-02 17:23:39 +00:00
parent 3001a754c1
commit e2df5ef0ed
16 changed files with 351 additions and 362 deletions
+1
View File
@@ -178,6 +178,7 @@ void sdPoll10ms();
// Power driver // Power driver
uint8_t pwrCheck(); uint8_t pwrCheck();
void pwrOff();
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown) #define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
#define EEPROM_MASSSTORAGE() (0) #define EEPROM_MASSSTORAGE() (0)
+22 -25
View File
@@ -851,37 +851,34 @@ void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
} }
#if ROTARY_ENCODERS > 0 #if ROTARY_ENCODERS > 0
if (idx >= SWSRC_FIRST_ROTENC_SWITCH) { else if (idx >= SWSRC_FIRST_ROTENC_SWITCH) {
if (idx <= SWSRC_LAST_ROTENC_SWITCH) { idx -= SWSRC_FIRST_ROTENC_SWITCH;
idx -= SWSRC_FIRST_ROTENC_SWITCH; char suffix = (idx & 1) ? 'l' : 's';
char suffix; lcd_putcAtt(x+3*FW, y, suffix, att);
if (idx < ROTARY_ENCODERS) { return lcd_putsiAtt(x, y, STR_VRENCODERS, idx/2, att);
suffix = 's'; }
} #endif
else {
idx -= ROTARY_ENCODERS; #if !defined(CPUM64)
suffix = 'l'; else if (idx >= SWSRC_TRAINER_SHORT) {
} idx -= SWSRC_TRAINER_SHORT;
lcd_putcAtt(x+3*FW, y, suffix, att); lcd_putcAtt(x+3*FW, y, (idx & 1) ? 'l' : 's', att);
return lcd_putsiAtt(x, y, STR_VRENCODERS, idx, att); #if ROTARY_ENCODERS > 0
if (idx >= 2) {
idx -= 2;
return lcd_putsiAtt(x, y, STR_VRENCODERS, idx/2, att);
}
else
#endif
{
return lcd_putsiAtt(x, y, STR_VSWITCHES, SWSRC_TRAINER-1, att);
} }
idx -= 2*ROTARY_ENCODERS;
} }
#endif #endif
if (idx > SWSRC_ON) { if (idx > SWSRC_ON) {
idx -= SWSRC_ON; idx -= SWSRC_ON;
char suffix = 'm'; char suffix = 'm';
#if defined(CPUARM)
if (idx > SWSRC_ON) {
suffix = 's';
idx -= SWSRC_ON;
if (idx > MAX_PSWITCH) {
suffix = 'l';
idx -= MAX_PSWITCH;
}
}
#endif
if (~att & SWCONDENSED) lcd_putcAtt(x+3*FW, y, suffix, att); if (~att & SWCONDENSED) lcd_putcAtt(x+3*FW, y, suffix, att);
} }
lcd_putsiAtt(x, y, STR_VSWITCHES, idx-1, att); lcd_putsiAtt(x, y, STR_VSWITCHES, idx-1, att);
@@ -942,7 +939,7 @@ void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags at
} }
} }
#if defined(ROTARY_ENCODERS) #if ROTARY_ENCODERS > 0
void putsRotaryEncoderMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att) void putsRotaryEncoderMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)
{ {
#if ROTARY_ENCODERS > 2 #if ROTARY_ENCODERS > 2
+59 -64
View File
@@ -531,6 +531,58 @@ 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] && strcmp(fn, line) < 0); return (!isfile && line[SD_SCREEN_FILE_LENGTH+1]) || (isfile==(bool)line[SD_SCREEN_FILE_LENGTH+1] && strcmp(fn, line) < 0);
} }
void onSdManagerMenu(const char *result)
{
char lfn[SD_SCREEN_FILE_LENGTH];
uint8_t index = m_posVert-1-s_pgOfs;
if (result == STR_SD_INFO) {
pushMenu(menuGeneralSdManagerInfo);
}
else if (result == STR_SD_FORMAT) {
displayPopup(STR_FORMATTING);
closeLogs();
#if defined(PCBSKY9X)
Card_state = SD_ST_DATA;
#endif
#if defined(CPUARM)
audioQueue.stopSD();
#endif
if (f_mkfs(0, 1, 0) == FR_OK) {
f_chdir("/");
reusableBuffer.sd.offset = -1;
}
else {
s_warning = STR_SDCARD_ERROR;
}
}
else if (result == STR_DELETE_FILE) {
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
strcat_P(lfn, PSTR("/"));
strcat(lfn, reusableBuffer.sd.lines[index]);
f_unlink(lfn);
strncpy(statusLineMsg, reusableBuffer.sd.lines[index], 13);
strcpy_P(statusLineMsg+min((uint8_t)strlen(statusLineMsg), (uint8_t)13), STR_REMOVED);
showStatusLine();
if ((uint16_t)m_posVert == reusableBuffer.sd.count) m_posVert--;
reusableBuffer.sd.offset = s_pgOfs-1;
}
#if defined(CPUARM)
/* TODO else if (result == STR_LOAD_FILE) {
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
strcat(lfn, "/");
strcat(lfn, reusableBuffer.sd.lines[index]);
s_warning = eeLoadModelSD(lfn);
} */
else if (result == STR_PLAY_FILE) {
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
strcat(lfn, "/");
strcat(lfn, reusableBuffer.sd.lines[index]);
audioQueue.playFile(lfn, PLAY_NOW);
}
#endif
}
void menuGeneralSdManager(uint8_t event) void menuGeneralSdManager(uint8_t event)
{ {
FILINFO fno; FILINFO fno;
@@ -544,11 +596,6 @@ void menuGeneralSdManager(uint8_t event)
char lfn[SD_SCREEN_FILE_LENGTH]; char lfn[SD_SCREEN_FILE_LENGTH];
#endif #endif
uint8_t _event = event;
if (s_menu_count) {
event = 0;
}
SIMPLE_MENU(SD_IS_HC() ? STR_SDHC_CARD : STR_SD_CARD, menuTabDiag, e_Sd, 1+reusableBuffer.sd.count); SIMPLE_MENU(SD_IS_HC() ? STR_SDHC_CARD : STR_SD_CARD, menuTabDiag, e_Sd, 1+reusableBuffer.sd.count);
if (s_editMode > 0) if (s_editMode > 0)
@@ -585,10 +632,9 @@ void menuGeneralSdManager(uint8_t event)
case EVT_KEY_LONG(KEY_ENTER): case EVT_KEY_LONG(KEY_ENTER):
killEvents(event); killEvents(event);
_event = 0;
if (m_posVert == 0) { if (m_posVert == 0) {
s_menu[s_menu_count++] = STR_SD_INFO; MENU_ADD_ITEM(STR_SD_INFO);
s_menu[s_menu_count++] = STR_SD_FORMAT; MENU_ADD_ITEM(STR_SD_FORMAT);
} }
else { else {
#if defined(CPUARM) #if defined(CPUARM)
@@ -599,13 +645,14 @@ void menuGeneralSdManager(uint8_t event)
s_menu[s_menu_count++] = STR_LOAD_FILE; s_menu[s_menu_count++] = STR_LOAD_FILE;
} }
else */ if (!strcmp(ext, SOUNDS_EXT)) { else */ if (!strcmp(ext, SOUNDS_EXT)) {
s_menu[s_menu_count++] = STR_PLAY_FILE; MENU_ADD_ITEM(STR_PLAY_FILE);
} }
#endif #endif
s_menu[s_menu_count++] = STR_DELETE_FILE; MENU_ADD_ITEM(STR_DELETE_FILE);
s_menu[s_menu_count++] = STR_RENAME_FILE; MENU_ADD_ITEM(STR_RENAME_FILE);
s_menu[s_menu_count++] = STR_COPY_FILE; MENU_ADD_ITEM(STR_COPY_FILE);
} }
menuHandler = onSdManagerMenu;
break; break;
} }
@@ -701,58 +748,6 @@ void menuGeneralSdManager(uint8_t event)
if (!reusableBuffer.sd.lines[i][SD_SCREEN_FILE_LENGTH+1]) { lcd_putcAtt(lcdLastPos, y, ']', attr); } if (!reusableBuffer.sd.lines[i][SD_SCREEN_FILE_LENGTH+1]) { lcd_putcAtt(lcdLastPos, y, ']', attr); }
} }
} }
if (s_menu_count) {
const char * result = displayMenu(_event);
if (result) {
uint8_t index = m_posVert-1-s_pgOfs;
if (result == STR_SD_INFO) {
pushMenu(menuGeneralSdManagerInfo);
}
else if (result == STR_SD_FORMAT) {
displayPopup(STR_FORMATTING);
closeLogs();
#if defined(PCBSKY9X)
Card_state = SD_ST_DATA;
#endif
#if defined(CPUARM)
audioQueue.stopSD();
#endif
if (f_mkfs(0, 1, 0) == FR_OK) {
f_chdir("/");
reusableBuffer.sd.offset = -1;
}
else {
s_warning = STR_SDCARD_ERROR;
}
}
else if (result == STR_DELETE_FILE) {
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
strcat_P(lfn, PSTR("/"));
strcat(lfn, reusableBuffer.sd.lines[index]);
f_unlink(lfn);
strncpy(statusLineMsg, reusableBuffer.sd.lines[index], 13);
strcpy_P(statusLineMsg+min((uint8_t)strlen(statusLineMsg), (uint8_t)13), STR_REMOVED);
showStatusLine();
if ((uint16_t)m_posVert == reusableBuffer.sd.count) m_posVert--;
reusableBuffer.sd.offset = s_pgOfs-1;
}
#if defined(CPUARM)
/* TODO else if (result == STR_LOAD_FILE) {
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
strcat(lfn, "/");
strcat(lfn, reusableBuffer.sd.lines[index]);
s_warning = eeLoadModelSD(lfn);
}
else */ if (result == STR_PLAY_FILE) {
f_getcwd(lfn, SD_SCREEN_FILE_LENGTH);
strcat(lfn, "/");
strcat(lfn, reusableBuffer.sd.lines[index]);
audioQueue.playFile(lfn, PLAY_NOW);
}
#endif
}
}
} }
#endif #endif
+137 -177
View File
@@ -181,6 +181,7 @@ bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen,
char *line = reusableBuffer.models.menu_bss[0]; char *line = reusableBuffer.models.menu_bss[0];
memset(line, 0, MENU_LINE_LENGTH); memset(line, 0, MENU_LINE_LENGTH);
strcpy(line, "---"); strcpy(line, "---");
s_menu[0] = line;
} }
} }
@@ -242,18 +243,70 @@ bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen,
} }
#endif #endif
void menuModelSelect(uint8_t event) #if defined(NAVIGATION_MENUS)
void onModelSelectMenu(const char *result)
{ {
#if defined(PCBSKY9X) int8_t sub = m_posVert;
#define REFRESH(x)
#elif defined(PCBGRUVIN9X) && defined(SDCARD) if (result == STR_SELECT_MODEL || result == STR_CREATE_MODEL) {
static bool refresh = true; displayPopup(STR_LOADINGMODEL);
#define REFRESH(x) refresh = (x) saveTimers();
eeCheck(true); // force writing of current model data before this is changed
if (g_eeGeneral.currModel != sub) {
g_eeGeneral.currModel = sub;
STORE_GENERALVARS;
eeLoadModel(sub);
}
}
#if defined(ROTARY_ENCODER_NAVIGATION)
else if (result == STR_COPY_MODEL) {
s_copyMode = COPY_MODE;
s_copyTgtOfs = 0;
s_copySrcRow = -1;
}
else if (result == STR_MOVE_MODEL) {
s_copyMode = MOVE_MODE;
s_copyTgtOfs = 0;
s_copySrcRow = -1;
}
#endif
#if defined(SDCARD)
else if (result == STR_BACKUP_MODEL) {
eeCheck(true); // force writing of current model data before this is changed
s_warning = eeBackupModel(sub);
}
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
if (!listSdFiles(MODELS_PATH, MODELS_EXT, sizeof(g_model.name), NULL)) {
s_warning = STR_NO_MODELS_ON_SD;
s_menu_flags = 0;
}
}
#endif
else if (result == STR_DELETE_MODEL) {
s_warning = STR_DELETEMODEL;
s_warning_type = WARNING_TYPE_CONFIRM;
#if defined(CPUARM)
s_warning_info = modelNames[sub];
#else #else
#define refresh event char * name = reusableBuffer.models.mainname;
#define REFRESH(x) eeLoadModelName(sub, name);
s_warning_info = name;
#endif
s_warning_info_len = sizeof(g_model.name);
}
#if defined(SDCARD)
else {
// The user choosed a file on SD to restore
s_warning = eeRestoreModel(sub, (char *)result);
if (!s_warning && g_eeGeneral.currModel == sub)
eeLoadModel(sub);
}
#endif
}
#endif #endif
void menuModelSelect(uint8_t event)
{
if (s_warning_result) { if (s_warning_result) {
eeDeleteModel(m_posVert); // delete file eeDeleteModel(m_posVert); // delete file
s_warning_result = 0; s_warning_result = 0;
@@ -261,13 +314,6 @@ void menuModelSelect(uint8_t event)
event = EVT_ENTRY_UP; event = EVT_ENTRY_UP;
} }
#if defined(NAVIGATION_MENUS)
uint8_t _event = event;
if (s_menu_count) {
event = 0;
}
#endif
uint8_t _event_ = (IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event) ? 0 : event); uint8_t _event_ = (IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event) ? 0 : event);
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
@@ -287,9 +333,6 @@ void menuModelSelect(uint8_t event)
#if !defined(CPUARM) #if !defined(CPUARM)
if (event) { if (event) {
eeFlush(); // flush eeprom write eeFlush(); // flush eeprom write
#if defined(SDCARD)
REFRESH(true);
#endif
} }
#endif #endif
@@ -400,7 +443,6 @@ void menuModelSelect(uint8_t event)
s_copyMode = 0; s_copyMode = 0;
killEvents(event); killEvents(event);
#if defined(NAVIGATION_MENUS) #if defined(NAVIGATION_MENUS)
_event = 0;
if (g_eeGeneral.currModel != sub) { if (g_eeGeneral.currModel != sub) {
if (eeModelExists(sub)) { if (eeModelExists(sub)) {
MENU_ADD_ITEM(STR_SELECT_MODEL); MENU_ADD_ITEM(STR_SELECT_MODEL);
@@ -431,6 +473,7 @@ void menuModelSelect(uint8_t event)
MENU_ADD_NAVIGATION_ITEM(STR_COPY_MODEL); MENU_ADD_NAVIGATION_ITEM(STR_COPY_MODEL);
MENU_ADD_NAVIGATION_ITEM(STR_MOVE_MODEL); MENU_ADD_NAVIGATION_ITEM(STR_MOVE_MODEL);
} }
menuHandler = onModelSelectMenu;
#else #else
if (g_eeGeneral.currModel != sub) { if (g_eeGeneral.currModel != sub) {
displayPopup(STR_LOADINGMODEL); displayPopup(STR_LOADINGMODEL);
@@ -507,12 +550,12 @@ void menuModelSelect(uint8_t event)
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
lcd_puts(27*FW-(LEN_FREE-4)*FW, 0, STR_FREE); lcd_puts(27*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
if (refresh) reusableBuffer.models.eepromfree = EeFsGetFree(); if (event) reusableBuffer.models.eepromfree = EeFsGetFree();
lcd_outdezAtt(20*FW, 0, reusableBuffer.models.eepromfree, 0); lcd_outdezAtt(20*FW, 0, reusableBuffer.models.eepromfree, 0);
lcd_puts(21*FW, 0, "bytes"); // TODO translations lcd_puts(21*FW, 0, "bytes"); // TODO translations
#elif !defined(PCBSKY9X) #elif !defined(PCBSKY9X)
lcd_puts(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE); lcd_puts(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
if (refresh) reusableBuffer.models.eepromfree = EeFsGetFree(); if (event) reusableBuffer.models.eepromfree = EeFsGetFree();
lcd_outdezAtt(17*FW, 0, reusableBuffer.models.eepromfree, 0); lcd_outdezAtt(17*FW, 0, reusableBuffer.models.eepromfree, 0);
#endif #endif
@@ -558,7 +601,7 @@ void menuModelSelect(uint8_t event)
lcd_outdezAtt(20*FW, y, eeModelSize(k), 0); lcd_outdezAtt(20*FW, y, eeModelSize(k), 0);
#else #else
char * name = reusableBuffer.models.listnames[i]; char * name = reusableBuffer.models.listnames[i];
if (refresh) eeLoadModelName(k, name); if (event) eeLoadModelName(k, name);
putsModelName(4*FW, y, name, k, 0); putsModelName(4*FW, y, name, k, 0);
lcd_outdezAtt(20*FW, y, eeModelSize(k), 0); lcd_outdezAtt(20*FW, y, eeModelSize(k), 0);
#endif #endif
@@ -570,71 +613,6 @@ void menuModelSelect(uint8_t event)
lcd_rect(8, y-1, LCD_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED); lcd_rect(8, y-1, LCD_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED);
} }
} }
#if defined(NAVIGATION_MENUS)
REFRESH(false);
if (s_menu_count) {
const char * result = displayMenu(_event);
if (result) {
REFRESH(true);
if (result == STR_SELECT_MODEL || result == STR_CREATE_MODEL) {
displayPopup(STR_LOADINGMODEL);
saveTimers();
eeCheck(true); // force writing of current model data before this is changed
if (g_eeGeneral.currModel != sub) {
g_eeGeneral.currModel = sub;
STORE_GENERALVARS;
eeLoadModel(sub);
}
}
#if defined(ROTARY_ENCODER_NAVIGATION)
else if (result == STR_COPY_MODEL) {
s_copyMode = COPY_MODE;
s_copyTgtOfs = 0;
s_copySrcRow = -1;
}
else if (result == STR_MOVE_MODEL) {
s_copyMode = MOVE_MODE;
s_copyTgtOfs = 0;
s_copySrcRow = -1;
}
#endif
#if defined(SDCARD)
else if (result == STR_BACKUP_MODEL) {
eeCheck(true); // force writing of current model data before this is changed
s_warning = eeBackupModel(sub);
}
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
if (!listSdFiles(MODELS_PATH, MODELS_EXT, sizeof(g_model.name), NULL)) {
s_warning = STR_NO_MODELS_ON_SD;
s_menu_flags = 0;
}
}
#endif
else if (result == STR_DELETE_MODEL) {
s_warning = STR_DELETEMODEL;
s_warning_type = WARNING_TYPE_CONFIRM;
#if defined(CPUARM)
s_warning_info = modelNames[sub];
#else
char * name = reusableBuffer.models.mainname;
eeLoadModelName(sub, name);
s_warning_info = name;
#endif
s_warning_info_len = sizeof(g_model.name);
}
#if defined(SDCARD)
else {
// The user choosed a file on SD to restore
s_warning = eeRestoreModel(sub, (char *)result);
if (!s_warning && g_eeGeneral.currModel == sub)
eeLoadModel(sub);
}
#endif
}
}
#endif
} }
void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uint8_t active) void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uint8_t active)
@@ -774,15 +752,26 @@ enum menuModelSetupItems {
#define MODEL_SETUP_2ND_COLUMN (LCD_W-11*FW-MENUS_SCROLLBAR_WIDTH) #define MODEL_SETUP_2ND_COLUMN (LCD_W-11*FW-MENUS_SCROLLBAR_WIDTH)
#endif #endif
void menuModelSetup(uint8_t event)
{
#if defined(PCBTARANIS) && defined(SDCARD) #if defined(PCBTARANIS) && defined(SDCARD)
uint8_t _event = event; void onModelSetupMenu(const char *result)
if (s_menu_count) { {
event = 0; if (result == STR_UPDATE_LIST) {
if (!listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), NULL)) {
s_warning = STR_NO_BITMAPS_ON_SD;
s_menu_flags = 0;
}
} }
else {
// The user choosed a bmp file in the list
memcpy(g_model.bitmap, result, sizeof(g_model.bitmap));
LOAD_MODEL_BITMAP();
eeDirty(EE_MODEL);
}
}
#endif #endif
void menuModelSetup(uint8_t event)
{
// TODO this is quick & dirty, should be done in place of the return which is hidden inside MENU(...) // TODO this is quick & dirty, should be done in place of the return which is hidden inside MENU(...)
#if defined(DSM2) #if defined(DSM2)
if (event == EVT_KEY_LONG(KEY_EXIT)) { if (event == EVT_KEY_LONG(KEY_EXIT)) {
@@ -831,13 +820,14 @@ void menuModelSetup(uint8_t event)
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr); lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr);
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) { if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
s_editMode = 0; s_editMode = 0;
_event = 0; if (listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), g_model.bitmap, LIST_NONE_SD_FILE)) {
if (!listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), g_model.bitmap, LIST_NONE_SD_FILE)) { menuHandler = onModelSetupMenu;
}
else {
s_warning = STR_NO_BITMAPS_ON_SD; s_warning = STR_NO_BITMAPS_ON_SD;
s_menu_flags = 0; s_menu_flags = 0;
} }
} }
break; break;
#endif #endif
@@ -1223,26 +1213,6 @@ void menuModelSetup(uint8_t event)
#endif // defined(PCBTARANIS) #endif // defined(PCBTARANIS)
} }
} }
#if defined(PCBTARANIS) && defined(SDCARD)
if (s_menu_count) {
const char * result = displayMenu(_event);
if (result) {
if (result == STR_UPDATE_LIST) {
if (!listSdFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.bitmap), NULL)) {
s_warning = STR_NO_BITMAPS_ON_SD;
s_menu_flags = 0;
}
}
else {
// The user choosed a bmp file in the list
memcpy(g_model.bitmap, result, sizeof(g_model.bitmap));
LOAD_MODEL_BITMAP();
eeDirty(EE_MODEL);
}
}
}
#endif
} }
static uint8_t s_currIdx; static uint8_t s_currIdx;
@@ -2497,6 +2467,35 @@ static uint8_t s_copySrcCh;
#define EXPO_LINE_SELECT_POS 18 #define EXPO_LINE_SELECT_POS 18
#endif #endif
#if defined(NAVIGATION_MENUS)
void onExpoMixMenu(const char *result)
{
bool expo = (g_menuStack[g_menuStackPtr] == menuModelExposAll);
uint8_t chn = (expo ? expoaddress(s_currIdx)->chn+1 : mixaddress(s_currIdx)->destCh+1);
if (result == STR_EDIT) {
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
}
else if (result == STR_INSERT_BEFORE || result == STR_INSERT_AFTER) {
if (!reachExpoMixCountLimit(expo)) {
s_currCh = chn;
if (result == STR_INSERT_AFTER) { s_currIdx++; m_posVert++; }
insertExpoMix(expo, s_currIdx);
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
}
}
else if (result == STR_COPY || result == STR_MOVE) {
s_copyMode = (result == STR_COPY ? COPY_MODE : MOVE_MODE);
s_copySrcIdx = s_currIdx;
s_copySrcCh = chn;
s_copySrcRow = m_posVert;
}
else if (result == STR_DELETE) {
deleteExpoMix(expo, s_currIdx);
}
}
#endif
void menuModelExpoMix(uint8_t expo, uint8_t event) void menuModelExpoMix(uint8_t expo, uint8_t event)
{ {
uint8_t sub = m_posVert; uint8_t sub = m_posVert;
@@ -2506,13 +2505,6 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
uint8_t chn = (expo ? expoaddress(s_currIdx)->chn+1 : mixaddress(s_currIdx)->destCh+1); uint8_t chn = (expo ? expoaddress(s_currIdx)->chn+1 : mixaddress(s_currIdx)->destCh+1);
#if defined(NAVIGATION_MENUS)
uint8_t _event = event;
if (s_menu_count) {
event = 0;
}
#endif
switch (event) switch (event)
{ {
case EVT_ENTRY: case EVT_ENTRY:
@@ -2582,7 +2574,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
return; return;
} }
else { else {
_event = event = 0; event = 0;
s_copyMode = 0; s_copyMode = 0;
MENU_ADD_ITEM(STR_EDIT); MENU_ADD_ITEM(STR_EDIT);
MENU_ADD_ITEM(STR_INSERT_BEFORE); MENU_ADD_ITEM(STR_INSERT_BEFORE);
@@ -2590,6 +2582,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
MENU_ADD_ITEM(STR_COPY); MENU_ADD_ITEM(STR_COPY);
MENU_ADD_ITEM(STR_MOVE); MENU_ADD_ITEM(STR_MOVE);
MENU_ADD_ITEM(STR_DELETE); MENU_ADD_ITEM(STR_DELETE);
menuHandler = onExpoMixMenu;
} }
#else #else
if (s_currCh) { if (s_currCh) {
@@ -2795,34 +2788,6 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
} }
s_maxLines = cur; s_maxLines = cur;
if (sub >= s_maxLines-1) m_posVert = s_maxLines-1; if (sub >= s_maxLines-1) m_posVert = s_maxLines-1;
#if defined(NAVIGATION_MENUS)
if (s_menu_count) {
const char * result = displayMenu(_event);
if (result) {
if (result == STR_EDIT) {
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
}
else if (result == STR_INSERT_BEFORE || result == STR_INSERT_AFTER) {
if (!reachExpoMixCountLimit(expo)) {
s_currCh = chn;
if (result == STR_INSERT_AFTER) { s_currIdx++; m_posVert++; }
insertExpoMix(expo, s_currIdx);
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
}
}
else if (result == STR_COPY || result == STR_MOVE) {
s_copyMode = (result == STR_COPY ? COPY_MODE : MOVE_MODE);
s_copySrcIdx = s_currIdx;
s_copySrcCh = chn;
s_copySrcRow = sub;
}
else if (result == STR_DELETE) {
deleteExpoMix(expo, s_currIdx);
}
}
}
#endif
} }
void menuModelExposAll(uint8_t event) void menuModelExposAll(uint8_t event)
@@ -3546,15 +3511,27 @@ void menuModelCustomSwitches(uint8_t event)
#define MODEL_CUSTOM_FUNC_4TH_COLUMN (18*FW+2) #define MODEL_CUSTOM_FUNC_4TH_COLUMN (18*FW+2)
#endif #endif
void menuModelCustomFunctions(uint8_t event)
{
#if defined(CPUARM) && defined(SDCARD) #if defined(CPUARM) && defined(SDCARD)
uint8_t _event = event; void onCustomFunctionsMenu(const char *result)
if (s_menu_count) { {
event = 0; int8_t sub = m_posVert - 1;
if (result == STR_UPDATE_LIST) {
if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(g_model.funcSw[sub].param), NULL)) {
s_warning = STR_NO_SOUNDS_ON_SD;
s_menu_flags = 0;
}
} }
else {
// The user choosed a wav file in the list
memcpy(g_model.funcSw[sub].param.name, result, sizeof(g_model.funcSw[sub].param.name));
eeDirty(EE_MODEL);
}
}
#endif #endif
void menuModelCustomFunctions(uint8_t event)
{
MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|3/*repeated*/}); MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|3/*repeated*/});
uint8_t y; uint8_t y;
@@ -3664,8 +3641,10 @@ void menuModelCustomFunctions(uint8_t event)
lcd_putsiAtt(x, y, STR_VCSWFUNC, 0, attr); lcd_putsiAtt(x, y, STR_VCSWFUNC, 0, attr);
if (active && event==EVT_KEY_BREAK(KEY_ENTER)) { if (active && event==EVT_KEY_BREAK(KEY_ENTER)) {
s_editMode = 0; s_editMode = 0;
_event = 0; if (listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(sd->param.name), sd->param.name)) {
if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(sd->param.name), sd->param.name)) { menuHandler = onCustomFunctionsMenu;
}
else {
s_warning = STR_NO_SOUNDS_ON_SD; s_warning = STR_NO_SOUNDS_ON_SD;
s_menu_flags = 0; s_menu_flags = 0;
} }
@@ -3817,25 +3796,6 @@ void menuModelCustomFunctions(uint8_t event)
} }
} }
} }
#if defined(CPUARM) && defined(SDCARD)
if (s_menu_count) {
const char * result = displayMenu(_event);
if (result) {
if (result == STR_UPDATE_LIST) {
if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT, sizeof(g_model.funcSw[sub].param), NULL)) {
s_warning = STR_NO_SOUNDS_ON_SD;
s_menu_flags = 0;
}
}
else {
// The user choosed a wav file in the list
memcpy(g_model.funcSw[sub].param.name, result, sizeof(g_model.funcSw[sub].param.name));
eeDirty(EE_MODEL);
}
}
}
#endif
} }
enum menuModelTelemetryItems { enum menuModelTelemetryItems {
+1
View File
@@ -846,6 +846,7 @@ uint8_t s_menu_item = 0;
uint16_t s_menu_count = 0; uint16_t s_menu_count = 0;
uint8_t s_menu_flags = 0; uint8_t s_menu_flags = 0;
uint16_t s_menu_offset = 0; uint16_t s_menu_offset = 0;
void (*menuHandler)(const char *result);
const char * displayMenu(uint8_t event) const char * displayMenu(uint8_t event)
{ {
const char * result = NULL; const char * result = NULL;
+1
View File
@@ -278,6 +278,7 @@ void displayWarning(uint8_t event);
extern uint8_t s_menu_flags; extern uint8_t s_menu_flags;
extern uint16_t s_menu_offset; extern uint16_t s_menu_offset;
const char * displayMenu(uint8_t event); const char * displayMenu(uint8_t event);
extern void (*menuHandler)(const char *result);
#else #else
#define s_menu_count 0 #define s_menu_count 0
#endif #endif
+9 -8
View File
@@ -475,7 +475,9 @@ enum Functions {
FUNC_TRAINER_AIL, FUNC_TRAINER_AIL,
FUNC_INSTANT_TRIM, FUNC_INSTANT_TRIM,
FUNC_PLAY_SOUND, FUNC_PLAY_SOUND,
#if !defined(PCBTARANIS)
FUNC_HAPTIC, FUNC_HAPTIC,
#endif
FUNC_RESET, FUNC_RESET,
FUNC_VARIO, FUNC_VARIO,
FUNC_PLAY_TRACK, FUNC_PLAY_TRACK,
@@ -951,23 +953,22 @@ enum SwitchSources {
SWSRC_FIRST_MOMENT_SWITCH, SWSRC_FIRST_MOMENT_SWITCH,
SWSRC_LAST_MOMENT_SWITCH = SWSRC_FIRST_MOMENT_SWITCH+SWSRC_ON-1, SWSRC_LAST_MOMENT_SWITCH = SWSRC_FIRST_MOMENT_SWITCH+SWSRC_ON-1,
#if !defined(CPUM64)
SWSRC_TRAINER_SHORT,
SWSRC_TRAINER_LONG,
#endif
#if ROTARY_ENCODERS > 0 #if ROTARY_ENCODERS > 0
SWSRC_FIRST_ROTENC_SWITCH, SWSRC_FIRST_ROTENC_SWITCH,
SWSRC_LAST_ROTENC_SWITCH = SWSRC_FIRST_ROTENC_SWITCH+(2*ROTARY_ENCODERS)-1, SWSRC_LAST_ROTENC_SWITCH = SWSRC_FIRST_ROTENC_SWITCH+(2*ROTARY_ENCODERS)-1,
#endif #endif
#if defined(CPUARM)
SWSRC_FIRST_SHORT_SWITCH,
SWSRC_LAST_SHORT_SWITCH = SWSRC_FIRST_SHORT_SWITCH + MAX_PSWITCH - 1,
SWSRC_FIRST_LONG_SWITCH,
SWSRC_LAST_LONG_SWITCH = SWSRC_FIRST_LONG_SWITCH + MAX_PSWITCH - 1,
#endif
SWSRC_COUNT, SWSRC_COUNT,
SWSRC_FIRST = -SWSRC_LAST_MOMENT_SWITCH, SWSRC_FIRST = -SWSRC_LAST_MOMENT_SWITCH,
SWSRC_LAST = SWSRC_COUNT-1, SWSRC_LAST = SWSRC_COUNT-1,
SWSRC_OFF = -SWSRC_ON SWSRC_OFF = -SWSRC_ON,
SWSRC_TRAINER = SWSRC_SW1-1,
}; };
enum MixSources { enum MixSources {
+58 -36
View File
@@ -985,8 +985,8 @@ bool __getSwitch(int8_t swtch)
} }
} }
else { else {
int16_t x = getValue(cs->v1-1); getvalue_t x = getValue(cs->v1-1);
int16_t y; getvalue_t y;
if (s == CS_VCOMP) { if (s == CS_VCOMP) {
y = getValue(cs->v2-1); y = getValue(cs->v2-1);
@@ -2163,7 +2163,7 @@ tmr10ms_t lastFunctionTime[NUM_CFN] = { 0 };
#if defined(VOICE) #if defined(VOICE)
PLAY_FUNCTION(playValue, uint8_t idx) PLAY_FUNCTION(playValue, uint8_t idx)
{ {
int16_t val = getValue(idx); getvalue_t val = getValue(idx);
switch (idx) { switch (idx) {
case MIXSRC_FIRST_TELEM-1+TELEM_TX_VOLTAGE-1: case MIXSRC_FIRST_TELEM-1+TELEM_TX_VOLTAGE-1:
@@ -2284,11 +2284,15 @@ PLAY_FUNCTION(playValue, uint8_t idx)
} }
#endif #endif
#if !defined(CPUM64)
uint8_t mSwitchDuration[1+NUM_ROTARY_ENCODERS] = { 0 };
#define CFN_PRESSLONG_DURATION 100
#endif
#if defined(CPUARM) #if defined(CPUARM)
uint8_t currentSpeakerVolume = 255; uint8_t currentSpeakerVolume = 255;
uint8_t requiredSpeakerVolume; uint8_t requiredSpeakerVolume;
uint8_t fnSwitchDuration[NUM_CFN] = { 0 }; uint8_t fnSwitchDuration[NUM_CFN] = { 0 };
#define CFN_PRESSLONG_DURATION 100
inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id) inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
{ {
@@ -2298,7 +2302,6 @@ inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
strcat(lfn+sizeof(SOUNDS_PATH), SOUNDS_EXT); strcat(lfn+sizeof(SOUNDS_PATH), SOUNDS_EXT);
PLAY_FILE(lfn, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id); PLAY_FILE(lfn, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id);
} }
#endif #endif
void evalFunctions() void evalFunctions()
@@ -2327,27 +2330,30 @@ void evalFunctions()
MASK_CFN_TYPE switch_mask = ((MASK_CFN_TYPE)1 << i); MASK_CFN_TYPE switch_mask = ((MASK_CFN_TYPE)1 << i);
uint8_t momentary = 0; uint8_t momentary = 0;
#if defined(CPUARM) #if !defined(CPUM64)
#define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \ #define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \
(shortPress && !active && fnSwitchDuration[i]>0 && fnSwitchDuration[i]<CFN_PRESSLONG_DURATION) || \ (short_long==1 && !active && mSwitchDuration[mswitch]>0 && mSwitchDuration[mswitch]<CFN_PRESSLONG_DURATION) || \
(longPress && active && fnSwitchDuration[i]>=CFN_PRESSLONG_DURATION) ) (short_long==2 && active && mSwitchDuration[mswitch]>=CFN_PRESSLONG_DURATION) )
uint8_t shortPress=0, longPress=0; uint8_t short_long = 0;
if (swtch > MAX_SWITCH+1+MAX_SWITCH+1+MAX_PSWITCH) { uint8_t mswitch = 0;
longPress = 1;
swtch -= MAX_SWITCH+1+MAX_SWITCH+1+MAX_PSWITCH; if (swtch == SWSRC_TRAINER_LONG) {
short_long = 2;
swtch = SWSRC_TRAINER;
mswitch = 0;
} }
else if (swtch > MAX_SWITCH+1+MAX_SWITCH+1) { else if (swtch == SWSRC_TRAINER_SHORT) {
shortPress = 1; short_long = 1;
swtch -= MAX_SWITCH+1+MAX_SWITCH+1; swtch = SWSRC_TRAINER;
mswitch = 0;
} }
else else
#else #else
#define shortPress 0 #define short_long 0
#define longPress 0
#define MOMENTARY_START_TEST() (!(activeSwitches & switch_mask) && active) #define MOMENTARY_START_TEST() (!(activeSwitches & switch_mask) && active)
#endif #endif
@@ -2363,37 +2369,43 @@ void evalFunctions()
bool active = getSwitch(swtch, 0); bool active = getSwitch(swtch, 0);
if (active) newActiveSwitches |= switch_mask; if (active) newActiveSwitches |= switch_mask;
if (momentary || longPress || shortPress) { if (momentary || short_long) {
#if defined(CPUARM) #if !defined(CPUM64)
bool swState = active; bool swState = active;
#endif #endif
if (MOMENTARY_START_TEST()) { if (MOMENTARY_START_TEST()) {
active = !(activeFnSwitches & switch_mask); if (short_long) {
#if !defined(CPUARM) active = false;
if (CFN_FUNC(sd) == FUNC_PLAY_BOTH && !active) { momentary = true;
momentary = 1;
} }
else else {
active = !(activeFnSwitches & switch_mask);
#if !defined(CPUARM)
if (CFN_FUNC(sd) == FUNC_PLAY_BOTH && !active) {
momentary = 1;
}
else
#endif #endif
{ {
momentary = 0; momentary = 0;
}
} }
} }
else { else {
active = (activeFnSwitches & switch_mask); active = (activeFnSwitches & switch_mask);
momentary = 0; momentary = 0;
} }
#if defined(CPUARM) #if !defined(CPUM64)
if (shortPress || longPress) { if (short_long) {
if (swState) { if (swState) {
if (fnSwitchDuration[i] < 255) if (mSwitchDuration[mswitch] < 255)
fnSwitchDuration[i]++; mSwitchDuration[mswitch]++;
} }
else { else {
fnSwitchDuration[i] = 0; mSwitchDuration[mswitch] = 0;
} }
} }
#endif #endif
@@ -2617,9 +2629,9 @@ void perOut(uint8_t mode, uint8_t tick10ms)
if(g_model.swashR.type) if(g_model.swashR.type)
{ {
int16_t vp = anas[ELE_STICK]+trims[ELE_STICK]; getvalue_t vp = anas[ELE_STICK]+trims[ELE_STICK];
int16_t vr = anas[AIL_STICK]+trims[AIL_STICK]; getvalue_t vr = anas[AIL_STICK]+trims[AIL_STICK];
int16_t vc = 0; getvalue_t vc = 0;
if (g_model.swashR.collectiveSource) if (g_model.swashR.collectiveSource)
vc = getValue(g_model.swashR.collectiveSource-1); vc = getValue(g_model.swashR.collectiveSource-1);
@@ -2694,7 +2706,7 @@ void perOut(uint8_t mode, uint8_t tick10ms)
bool sw = getSwitch(md->swtch, 1); bool sw = getSwitch(md->swtch, 1);
//========== VALUE =============== //========== VALUE ===============
int16_t v = 0; getvalue_t v = 0;
if (mode != e_perout_mode_normal) { if (mode != e_perout_mode_normal) {
if (!sw || k >= NUM_STICKS || (k == THR_STICK && g_model.thrTrim)) { if (!sw || k >= NUM_STICKS || (k == THR_STICK && g_model.thrTrim)) {
continue; continue;
@@ -3453,13 +3465,23 @@ void perMain()
lcd_clear(); lcd_clear();
const char *warn = s_warning; const char *warn = s_warning;
uint8_t menu = s_menu_count;
if (EEPROM_MASSSTORAGE()) { if (EEPROM_MASSSTORAGE()) {
menuMainView(0); menuMainView(0);
} }
else { else {
g_menuStack[g_menuStackPtr](warn ? 0 : evt); g_menuStack[g_menuStackPtr]((warn || menu) ? 0 : evt);
if (warn) displayWarning(evt); if (warn) displayWarning(evt);
#if defined(NAVIGATION_MENUS)
if (menu) {
const char * result = displayMenu(evt);
if (result) {
menuHandler(result);
putEvent(EVT_MENU_UP);
}
}
#endif
} }
drawStatusLine(); drawStatusLine();
+21 -20
View File
@@ -569,33 +569,34 @@ enum CswFunctions {
#define SPLASH_TIMEOUT (4*100) // 4 seconds #define SPLASH_TIMEOUT (4*100) // 4 seconds
#endif #endif
#define EVT_KEY_MASK(e) ((e) & 0x0f) #define EVT_KEY_MASK(e) ((e) & 0x1f)
#define _MSK_KEY_BREAK 0x20 #define _MSK_KEY_BREAK 0x20
#define _MSK_KEY_REPT 0x40 #define _MSK_KEY_REPT 0x40
#define _MSK_KEY_FIRST 0x60 #define _MSK_KEY_FIRST 0x60
#define _MSK_KEY_LONG 0x80 #define _MSK_KEY_LONG 0x80
#define EVT_KEY_BREAK(key) ((key)|_MSK_KEY_BREAK) #define EVT_KEY_BREAK(key) ((key)|_MSK_KEY_BREAK)
#define EVT_KEY_FIRST(key) ((key)|_MSK_KEY_FIRST) #define EVT_KEY_FIRST(key) ((key)|_MSK_KEY_FIRST)
#define EVT_KEY_REPT(key) ((key)|_MSK_KEY_REPT) #define EVT_KEY_REPT(key) ((key)|_MSK_KEY_REPT)
#define EVT_KEY_LONG(key) ((key)|_MSK_KEY_LONG) #define EVT_KEY_LONG(key) ((key)|_MSK_KEY_LONG)
#define IS_KEY_BREAK(evt) (((evt)&0xf0) == _MSK_KEY_BREAK) #define IS_KEY_BREAK(evt) (((evt)&0xe0) == _MSK_KEY_BREAK)
#define IS_KEY_FIRST(evt) (((evt)&0xf0) == _MSK_KEY_FIRST) #define IS_KEY_FIRST(evt) (((evt)&0xe0) == _MSK_KEY_FIRST)
#define IS_KEY_LONG(evt) (((evt)&0xf0) == _MSK_KEY_LONG) #define IS_KEY_LONG(evt) (((evt)&0xe0) == _MSK_KEY_LONG)
#define EVT_ENTRY 0xbf #define EVT_ENTRY 0xbf
#define EVT_ENTRY_UP 0xbe #define EVT_ENTRY_UP 0xbe
#define EVT_MENU_UP 0xbd
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
#define EVT_ROTARY_BREAK EVT_KEY_BREAK(KEY_ENTER) #define EVT_ROTARY_BREAK EVT_KEY_BREAK(KEY_ENTER)
#define EVT_ROTARY_LONG EVT_KEY_LONG(KEY_ENTER) #define EVT_ROTARY_LONG EVT_KEY_LONG(KEY_ENTER)
#else #else
#define EVT_ROTARY_BREAK 0xcf #define EVT_ROTARY_BREAK 0xcf
#define EVT_ROTARY_LONG 0xce #define EVT_ROTARY_LONG 0xce
#define EVT_ROTARY_LEFT 0xdf #define EVT_ROTARY_LEFT 0xdf
#define EVT_ROTARY_RIGHT 0xde #define EVT_ROTARY_RIGHT 0xde
#endif #endif
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
+1 -1
View File
@@ -241,7 +241,7 @@ void eepromInit();
void rotencInit(); void rotencInit();
void rotencEnd(); void rotencEnd();
#if defined(ROTARY_ENCODERS) #if ROTARY_ENCODERS > 0
#define rotencDown() (!(PIOB->PIO_PDSR & 0x40)) #define rotencDown() (!(PIOB->PIO_PDSR & 0x40))
#else #else
#define rotencDown() 0 #define rotencDown() 0
+1 -1
View File
@@ -122,7 +122,7 @@ void readKeysAndTrims()
{ {
register uint32_t i; register uint32_t i;
#if defined(ROTARY_ENCODERS) #if ROTARY_ENCODERS > 0
keys[BTN_REa].input(rotencDown(), BTN_REa); keys[BTN_REa].input(rotencDown(), BTN_REa);
#endif #endif
+4
View File
@@ -113,6 +113,7 @@ void USBD_USR_DeviceConnected (void)
f_mount(0, 0); // unmount SD f_mount(0, 0); // unmount SD
} }
eeCheck(true);
usb_connected = 1; usb_connected = 1;
} }
@@ -127,6 +128,9 @@ void USBD_USR_DeviceDisconnected (void)
{ {
usb_connected = 0; usb_connected = 0;
eeReadAll();
eeLoadModel(g_eeGeneral.currModel);
sdInit(); sdInit();
} }
+21 -19
View File
@@ -2,7 +2,7 @@
* Authors (alphabetical order) * Authors (alphabetical order)
* - Andre Bernet <bernet.andre@gmail.com> * - Andre Bernet <bernet.andre@gmail.com>
* - Andreas Weitl <andreas.weitl@gmx.de> * - Andreas Weitl <andreas.weitl@gmx.de>
* - Hellmut Renz <hrenz62961@aol.com> * - Helmut Renz <hrenz62961@aol.com>
* - Thomas Husterer * - Thomas Husterer
* *
* opentx is based on code named * opentx is based on code named
@@ -135,12 +135,14 @@
#endif #endif
#if defined(AUDIO) #if defined(AUDIO)
#define TR_SOUND "Play Sound" #define TR_SOUND "Spiel T\203ne"
#else #else
#define TR_SOUND "Piep\0 " #define TR_SOUND "Spiel\0 "
#endif #endif
#if defined(HAPTIC) #if defined(PCBTARANIS)
#define TR_HAPTIC
#elif defined(HAPTIC)
#define TR_HAPTIC "Haptic\0 " #define TR_HAPTIC "Haptic\0 "
#else #else
#define TR_HAPTIC "[Haptic]\0 " #define TR_HAPTIC "[Haptic]\0 "
@@ -148,16 +150,16 @@
#if defined(VOICE) #if defined(VOICE)
#if defined(PCBSKY9X) #if defined(PCBSKY9X)
#define TR_PY_TRACK "Play\0 " #define TR_PY_TRACK "Spiel\0 "
#else #else
#define TR_PLAY_TRACK "Play Track" #define TR_PLAY_TRACK "Sag Text\0 "
#endif #endif
#define TR_PLAY_BOTH "Play Beide" #define TR_PLAY_BOTH "Sag Beide "
#define TR_PLAY_VALUE "Play Wert\0" #define TR_PLAY_VALUE "Sag Wert\0 "
#else #else
#define TR_PLAY_TRACK "[Play Trk]" #define TR_PLAY_TRACK "[Sag Text]"
#define TR_PLAY_BOTH "[Play Bth]" #define TR_PLAY_BOTH "[SagBeide]"
#define TR_PLAY_VALUE "[Play Val]" #define TR_PLAY_VALUE "[Sag Wert]"
#endif #endif
#define TR_CFN_VOLUME "Lautst\201rke" #define TR_CFN_VOLUME "Lautst\201rke"
@@ -194,7 +196,7 @@
#if defined(FRSKY) #if defined(FRSKY)
#define TR_FSW_RESET_TELEM TR("Telem", "Telemetry") #define TR_FSW_RESET_TELEM TR("Telem", "Telemetry")
#else #else
#define TR_FSW_RESET_TELEM #define TR_FSW_RESET_TELEM
#endif #endif
#if ROTARY_ENCODERS > 0 #if ROTARY_ENCODERS > 0
@@ -203,7 +205,7 @@
#define TR_FSW_RESET_ROTENC #define TR_FSW_RESET_ROTENC
#endif #endif
#define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""All\0 " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1 ""Timer 2 ""Alles " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC) #define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""Alle\0" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1 ""Timer 2 ""Alle Tmr." TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
#define LEN_FUNCSOUNDS "\006" #define LEN_FUNCSOUNDS "\006"
#define TR_FUNCSOUNDS "Piep1\0""Piep2\0""Piep3\0""Warn1\0""Warn2\0""Cheep\0""Ring\0 ""SciFi\0""Robot\0""Chirp\0""Tada\0 ""Crickt""Siren\0""AlmClk""Ratata""Tick\0 " #define TR_FUNCSOUNDS "Piep1\0""Piep2\0""Piep3\0""Warn1\0""Warn2\0""Cheep\0""Ring\0 ""SciFi\0""Robot\0""Chirp\0""Tada\0 ""Crickt""Siren\0""AlmClk""Ratata""Tick\0 "
@@ -253,7 +255,7 @@
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0" #define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
#define LEN_VKEYS "\005" #define LEN_VKEYS "\005"
#define TR_VKEYS " Menu"" Exit""Enter"" Page"" Plus""Minus" #define TR_VKEYS TR(" Menu"" Exit"" Down"" Up""Right"" Left", " Menu"" Exit""Enter"" Page"" Plus""Minus")
#define LEN_VRENCODERS "\003" #define LEN_VRENCODERS "\003"
#define TR_VRENCODERS "DGa""DGb" //Digitalgeber a und b = Drehgeber #define TR_VRENCODERS "DGa""DGb" //Digitalgeber a und b = Drehgeber
@@ -330,7 +332,7 @@
#define TR_MOVINGMODEL "Schiebe Modell" #define TR_MOVINGMODEL "Schiebe Modell"
#define TR_LOADINGMODEL "Lade Modell..." #define TR_LOADINGMODEL "Lade Modell..."
#define TR_NAME "Name" #define TR_NAME "Name"
#define TR_MODELNAME "Model Name" #define TR_MODELNAME "Modell Name"
#define TR_PHASENAME "Phase Name" #define TR_PHASENAME "Phase Name"
#define TR_MIXNAME "Mix Name" #define TR_MIXNAME "Mix Name"
#define TR_EXPONAME "Expo Name" #define TR_EXPONAME "Expo Name"
@@ -383,13 +385,13 @@
#define TR_MIXER "MISCHER" #define TR_MIXER "MISCHER"
#define TR_CV "KV" #define TR_CV "KV"
#define TR_GV "GV" #define TR_GV "GV"
#define TR_ACHANNEL "A\004channel" #define TR_ACHANNEL "A\004Kanal "
#define TR_RANGE INDENT"Skala" #define TR_RANGE INDENT"Skala"
#define TR_BAR "Streifen" #define TR_BAR "Streifen"
#define TR_ALARM INDENT"Alarm" #define TR_ALARM INDENT"Alarm"
#define TR_USRDATA "Daten" #define TR_USRDATA "Daten"
#define TR_BLADES INDENT"Bl\201tter" #define TR_BLADES INDENT"Bl\201tter"
#define TR_SCREEN "Schirm" #define TR_SCREEN "Bild "
#define TR_SOUND_LABEL "Ton" #define TR_SOUND_LABEL "Ton"
#define TR_LENGTH INDENT"Dauer" #define TR_LENGTH INDENT"Dauer"
#define TR_SPKRPITCH INDENT"Tonh\203he" #define TR_SPKRPITCH INDENT"Tonh\203he"
@@ -403,11 +405,11 @@
#define TR_MEMORYWARNING INDENT"Speicher voll" #define TR_MEMORYWARNING INDENT"Speicher voll"
#define TR_ALARMWARNING INDENT"Ton aus" #define TR_ALARMWARNING INDENT"Ton aus"
#define TR_RENAVIG "Drehgeb. Navig." #define TR_RENAVIG "Drehgeb. Navig."
#define TR_THROTTLEREVERSE TR("Gasumkehrung?","Gasumkehrung?") #define TR_THROTTLEREVERSE TR("Vollgas hinten?", "Vollgas hinten?")
#define TR_MINUTEBEEP TR(INDENT"Minute",INDENT"Jede Minute") #define TR_MINUTEBEEP TR(INDENT"Minute",INDENT"Jede Minute")
#define TR_BEEPCOUNTDOWN INDENT"Countdown" #define TR_BEEPCOUNTDOWN INDENT"Countdown"
#define TR_PERSISTENT TR(INDENT"Dauernd",INDENT"Dauernd ein") #define TR_PERSISTENT TR(INDENT"Dauernd",INDENT"Dauernd ein")
#define TR_BACKLIGHT_LABEL "LCD Licht" #define TR_BACKLIGHT_LABEL "LCD Licht an"
#define TR_BLDELAY INDENT"Dauer" #define TR_BLDELAY INDENT"Dauer"
#define TR_BLONBRIGHTNESS INDENT"An Helligkeit" #define TR_BLONBRIGHTNESS INDENT"An Helligkeit"
#define TR_BLOFFBRIGHTNESS INDENT"Aus Helligkeit" #define TR_BLOFFBRIGHTNESS INDENT"Aus Helligkeit"
+8 -4
View File
@@ -152,7 +152,9 @@
#define TR_SOUND "Beep\0 " #define TR_SOUND "Beep\0 "
#endif #endif
#if defined(HAPTIC) #if defined(PCBTARANIS)
#define TR_HAPTIC
#elif defined(HAPTIC)
#define TR_HAPTIC "Haptic\0 " #define TR_HAPTIC "Haptic\0 "
#else #else
#define TR_HAPTIC "[Haptic]\0 " #define TR_HAPTIC "[Haptic]\0 "
@@ -209,8 +211,10 @@
#define TR_FSW_RESET_TELEM #define TR_FSW_RESET_TELEM
#endif #endif
#if ROTARY_ENCODERS > 0 #if ROTARY_ENCODERS == 2
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc ") #define TR_FSW_RESET_ROTENC TR("REa\0 ""REb\0 ", "RotEnc A\0""RotEnc B\0")
#elif ROTARY_ENCODERS == 1
#define TR_FSW_RESET_ROTENC TR("R.Enc", "RotEnc\0 ")
#else #else
#define TR_FSW_RESET_ROTENC #define TR_FSW_RESET_ROTENC
#endif #endif
@@ -265,7 +269,7 @@
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0" #define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
#define LEN_VKEYS "\005" #define LEN_VKEYS "\005"
#define TR_VKEYS " Menu"" Exit"" Down"" Up""Right"" Left" #define TR_VKEYS TR(" Menu"" Exit"" Down"" Up""Right"" Left", " Menu"" Exit""Enter"" Page"" Plus""Minus")
#define LEN_VRENCODERS "\003" #define LEN_VRENCODERS "\003"
#define TR_VRENCODERS "REa""REb" #define TR_VRENCODERS "REa""REb"
+2 -2
View File
@@ -594,8 +594,8 @@ void menuMainView(uint8_t event)
// Switches // Switches
for (uint8_t i=0; i<8; i++) { for (uint8_t i=0; i<8; i++) {
uint8_t sw; getvalue_t sw;
int16_t val; getvalue_t val;
// TODO simplify this + reuse code in checkSwitches() + Menu MODELSETUP // TODO simplify this + reuse code in checkSwitches() + Menu MODELSETUP
switch(i) { switch(i) {
case 5: case 5:
+5 -5
View File
@@ -368,7 +368,7 @@ void menuTelemetryFrsky(uint8_t event)
s_frsky_view = 0; s_frsky_view = 0;
break; break;
case EVT_KEY_FIRST(KEY_MENU): case EVT_KEY_FIRST(KEY_ENTER):
resetTelemetry(); resetTelemetry();
break; break;
} }
@@ -384,14 +384,14 @@ void menuTelemetryFrsky(uint8_t event)
for (int8_t i=3; i>=0; i--) { for (int8_t i=3; i>=0; i--) {
FrSkyBarData & bar = screen.bars[i]; FrSkyBarData & bar = screen.bars[i];
uint8_t source = bar.source; uint8_t source = bar.source;
int16_t barMin = convertTelemValue(source, bar.barMin); getvalue_t barMin = convertTelemValue(source, bar.barMin);
int16_t barMax = convertTelemValue(source, 255-bar.barMax); getvalue_t barMax = convertTelemValue(source, 255-bar.barMax);
if (source && barMax > barMin) { if (source && barMax > barMin) {
uint8_t y = barHeight+6+i*(barHeight+6); uint8_t y = barHeight+6+i*(barHeight+6);
lcd_putsiAtt(0, y+barHeight-5, STR_VTELEMCHNS, source, 0); lcd_putsiAtt(0, y+barHeight-5, STR_VTELEMCHNS, source, 0);
lcd_rect(25, y, 101, barHeight+2); lcd_rect(25, y, 101, barHeight+2);
int16_t value = getValue(MIXSRC_FIRST_TELEM+source-2); getvalue_t value = getValue(MIXSRC_FIRST_TELEM+source-2);
int16_t threshold = 0; getvalue_t threshold = 0;
uint8_t thresholdX = 0; uint8_t thresholdX = 0;
if (source <= TELEM_TM2) if (source <= TELEM_TM2)
threshold = 0; threshold = 0;