mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 13:25:20 +03:00
No more global warning displayed only on Main View. Global warning will
be displayed on all menus. Saves flash on stock 9x!
This commit is contained in:
parent
7ba16bccb4
commit
aaec5f8fb0
19 changed files with 38 additions and 31 deletions
|
@ -494,7 +494,7 @@ void RlcFile::nextWriteStep()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_write_err == ERR_FULL) {
|
if (s_write_err == ERR_FULL) {
|
||||||
s_global_warning = STR_EEPROMOVERFLOW;
|
POPUP_WARNING(STR_EEPROMOVERFLOW);
|
||||||
m_write_step = 0;
|
m_write_step = 0;
|
||||||
m_write_len = 0;
|
m_write_len = 0;
|
||||||
m_cur_rlc_len = 0;
|
m_cur_rlc_len = 0;
|
||||||
|
|
|
@ -692,10 +692,10 @@ void flashBootloader(const char * filename)
|
||||||
f_open(&file, filename, FA_READ);
|
f_open(&file, filename, FA_READ);
|
||||||
uint8_t buffer[1024];
|
uint8_t buffer[1024];
|
||||||
UINT count;
|
UINT count;
|
||||||
|
|
||||||
lcd_clear();
|
lcd_clear();
|
||||||
lcd_putsLeft(4*FH, "\032Writing...");
|
lcd_putsLeft(4*FH, STR_WRITING);
|
||||||
lcd_rect(3, 6*FH+4, 204, 7);
|
lcd_rect(3, 6*FH+4, 204, 7);
|
||||||
watchdogSetTimeout(1000/*10s*/);
|
|
||||||
|
|
||||||
static uint8_t unlocked = 0;
|
static uint8_t unlocked = 0;
|
||||||
if (!unlocked) {
|
if (!unlocked) {
|
||||||
|
@ -704,12 +704,13 @@ void flashBootloader(const char * filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<BOOTLOADER_SIZE; i+=1024) {
|
for (int i=0; i<BOOTLOADER_SIZE; i+=1024) {
|
||||||
|
watchdogSetTimeout(100/*1s*/);
|
||||||
if (f_read(&file, buffer, 1024, &count) != FR_OK || count != 1024) {
|
if (f_read(&file, buffer, 1024, &count) != FR_OK || count != 1024) {
|
||||||
// TODO popup error
|
POPUP_WARNING(STR_SDCARD_ERROR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i==0 && !isBootloaderStart((uint32_t *)buffer)) {
|
if (i==0 && !isBootloaderStart((uint32_t *)buffer)) {
|
||||||
// TODO popup error
|
POPUP_WARNING(STR_INCOMPATIBLE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (int j=0; j<1024; j+=FLASH_PAGESIZE) {
|
for (int j=0; j<1024; j+=FLASH_PAGESIZE) {
|
||||||
|
@ -733,7 +734,7 @@ void onSdManagerMenu(const char *result)
|
||||||
pushMenu(menuGeneralSdManagerInfo);
|
pushMenu(menuGeneralSdManagerInfo);
|
||||||
}
|
}
|
||||||
else if (result == STR_SD_FORMAT) {
|
else if (result == STR_SD_FORMAT) {
|
||||||
POPUP_CONFIRMATION(PSTR("Confirm Format?"));
|
POPUP_CONFIRMATION(STR_CONFIRM_FORMAT);
|
||||||
}
|
}
|
||||||
else if (result == STR_DELETE_FILE) {
|
else if (result == STR_DELETE_FILE) {
|
||||||
f_getcwd(lfn, _MAX_LFN);
|
f_getcwd(lfn, _MAX_LFN);
|
||||||
|
|
|
@ -1036,7 +1036,6 @@ uint8_t s_warning_info_len;
|
||||||
// uint8_t s_warning_info_att not needed now
|
// uint8_t s_warning_info_att not needed now
|
||||||
uint8_t s_warning_type;
|
uint8_t s_warning_type;
|
||||||
uint8_t s_warning_result = 0;
|
uint8_t s_warning_result = 0;
|
||||||
const pm_char * s_global_warning = NULL;
|
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
int16_t s_warning_input_value;
|
int16_t s_warning_input_value;
|
||||||
|
|
|
@ -342,8 +342,6 @@ extern uint8_t s_warning_info_len;
|
||||||
extern uint8_t s_warning_result;
|
extern uint8_t s_warning_result;
|
||||||
extern uint8_t s_warning_type;
|
extern uint8_t s_warning_type;
|
||||||
|
|
||||||
extern const pm_char * s_global_warning;
|
|
||||||
|
|
||||||
#define WARNING_LINE_X 16
|
#define WARNING_LINE_X 16
|
||||||
#define WARNING_LINE_Y 3*FH
|
#define WARNING_LINE_Y 3*FH
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
|
|
|
@ -499,13 +499,8 @@ void menuMainView(uint8_t event)
|
||||||
uint8_t view_base = view & 0x0f;
|
uint8_t view_base = view & 0x0f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8_t _event = event;
|
switch(event) {
|
||||||
if (s_global_warning) {
|
|
||||||
event = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(event)
|
|
||||||
{
|
|
||||||
case EVT_ENTRY:
|
case EVT_ENTRY:
|
||||||
killEvents(KEY_EXIT);
|
killEvents(KEY_EXIT);
|
||||||
killEvents(KEY_UP);
|
killEvents(KEY_UP);
|
||||||
|
@ -637,16 +632,13 @@ void menuMainView(uint8_t event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case EVT_KEY_FIRST(KEY_EXIT):
|
case EVT_KEY_FIRST(KEY_EXIT):
|
||||||
if (s_global_warning) {
|
|
||||||
s_global_warning = NULL;
|
|
||||||
}
|
|
||||||
#if defined(GVARS) && !defined(PCBSTD)
|
#if defined(GVARS) && !defined(PCBSTD)
|
||||||
else if (s_gvar_timer > 0) {
|
if (s_gvar_timer > 0) {
|
||||||
s_gvar_timer = 0;
|
s_gvar_timer = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !defined(PCBTARANIS)
|
#if !defined(PCBTARANIS)
|
||||||
else if (view == VIEW_TIMER2) {
|
if (view == VIEW_TIMER2) {
|
||||||
resetTimer(1);
|
resetTimer(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -871,15 +863,8 @@ void menuMainView(uint8_t event)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (s_global_warning) {
|
|
||||||
s_warning = s_global_warning;
|
|
||||||
displayWarning(_event);
|
|
||||||
if (!s_warning) s_global_warning = NULL;
|
|
||||||
s_warning = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(GVARS) && !defined(PCBSTD)
|
#if defined(GVARS) && !defined(PCBSTD)
|
||||||
else if (s_gvar_timer > 0) {
|
if (s_gvar_timer > 0) {
|
||||||
s_gvar_timer--;
|
s_gvar_timer--;
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
lcd_filled_rect(BITMAP_X, BITMAP_Y, 64, 32, SOLID, ERASE);
|
lcd_filled_rect(BITMAP_X, BITMAP_Y, 64, 32, SOLID, ERASE);
|
||||||
|
|
|
@ -197,7 +197,7 @@ void writeLogs()
|
||||||
if (result != NULL) {
|
if (result != NULL) {
|
||||||
if (result != error_displayed) {
|
if (result != error_displayed) {
|
||||||
error_displayed = result;
|
error_displayed = result;
|
||||||
s_global_warning = result;
|
POPUP_WARNING(result);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,7 @@ void writeLogs()
|
||||||
|
|
||||||
if (result<0 && !error_displayed) {
|
if (result<0 && !error_displayed) {
|
||||||
error_displayed = STR_SDCARD_ERROR;
|
error_displayed = STR_SDCARD_ERROR;
|
||||||
s_global_warning = STR_SDCARD_ERROR;
|
POPUP_WARNING(STR_SDCARD_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -677,7 +677,7 @@ void telemetryWakeup()
|
||||||
if (alarmsCheckStep == 0) {
|
if (alarmsCheckStep == 0) {
|
||||||
if ((IS_MODULE_XJT(0) || IS_MODULE_XJT(1)) && frskyData.swr.value > 0x33) {
|
if ((IS_MODULE_XJT(0) || IS_MODULE_XJT(1)) && frskyData.swr.value > 0x33) {
|
||||||
AUDIO_SWR_RED();
|
AUDIO_SWR_RED();
|
||||||
s_global_warning = STR_ANTENNAPROBLEM;
|
POPUP_WARNING(STR_ANTENNAPROBLEM);
|
||||||
alarmsCheckTime = get_tmr10ms() + 300; /* next check in 3seconds */
|
alarmsCheckTime = get_tmr10ms() + 300; /* next check in 3seconds */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,6 +466,8 @@ const pm_char STR_CHANNELS_MONITOR[] PROGMEM = TR_CHANNELS_MONITOR;
|
||||||
const pm_char STR_PATH_TOO_LONG[] PROGMEM = TR_PATH_TOO_LONG;
|
const pm_char STR_PATH_TOO_LONG[] PROGMEM = TR_PATH_TOO_LONG;
|
||||||
const pm_char STR_VIEW_TEXT[] PROGMEM = TR_VIEW_TEXT;
|
const pm_char STR_VIEW_TEXT[] PROGMEM = TR_VIEW_TEXT;
|
||||||
const pm_char STR_FLASH_BOOTLOADER[] PROGMEM = TR_FLASH_BOOTLOADER;
|
const pm_char STR_FLASH_BOOTLOADER[] PROGMEM = TR_FLASH_BOOTLOADER;
|
||||||
|
const pm_char STR_WRITING[] PROGMEM = TR_WRITING;
|
||||||
|
const pm_char STR_CONFIRM_FORMAT[] PROGMEM = TR_CONFIRM_FORMAT;
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
const pm_char STR_MODELNAME[] PROGMEM = TR_MODELNAME;
|
const pm_char STR_MODELNAME[] PROGMEM = TR_MODELNAME;
|
||||||
|
|
|
@ -617,6 +617,8 @@ extern const pm_char STR_CHANNELS_MONITOR[];
|
||||||
extern const pm_char STR_PATH_TOO_LONG[];
|
extern const pm_char STR_PATH_TOO_LONG[];
|
||||||
extern const pm_char STR_VIEW_TEXT[];
|
extern const pm_char STR_VIEW_TEXT[];
|
||||||
extern const pm_char STR_FLASH_BOOTLOADER[];
|
extern const pm_char STR_FLASH_BOOTLOADER[];
|
||||||
|
extern const pm_char STR_WRITING[];
|
||||||
|
extern const pm_char STR_CONFIRM_FORMAT[];
|
||||||
|
|
||||||
#if defined(VOICE) && defined(CPUARM)
|
#if defined(VOICE) && defined(CPUARM)
|
||||||
struct LanguagePack {
|
struct LanguagePack {
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Cesta je moc dlouhá"
|
#define TR_PATH_TOO_LONG "Cesta je moc dlouhá"
|
||||||
#define TR_VIEW_TEXT "Zobrazit text"
|
#define TR_VIEW_TEXT "Zobrazit text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Vnitřní RF modul"
|
#define TR_INTERNALRF "Vnitřní RF modul"
|
||||||
#define TR_EXTERNALRF "Externí RF modul"
|
#define TR_EXTERNALRF "Externí RF modul"
|
||||||
#define TR_FAILSAFE "Mód Failsafe"
|
#define TR_FAILSAFE "Mód Failsafe"
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Path too long"
|
#define TR_PATH_TOO_LONG "Path too long"
|
||||||
#define TR_VIEW_TEXT "View text"
|
#define TR_VIEW_TEXT "View text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "----Internes HF Modul----------"
|
#define TR_INTERNALRF "----Internes HF Modul----------"
|
||||||
#define TR_EXTERNALRF "----Externes HF Modul----------"
|
#define TR_EXTERNALRF "----Externes HF Modul----------"
|
||||||
#define TR_FAILSAFE "Failsafe Mode"
|
#define TR_FAILSAFE "Failsafe Mode"
|
||||||
|
|
|
@ -717,6 +717,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Path too long"
|
#define TR_PATH_TOO_LONG "Path too long"
|
||||||
#define TR_VIEW_TEXT "View text"
|
#define TR_VIEW_TEXT "View text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Internal RF"
|
#define TR_INTERNALRF "Internal RF"
|
||||||
#define TR_EXTERNALRF "External RF"
|
#define TR_EXTERNALRF "External RF"
|
||||||
#define TR_FAILSAFE INDENT "Failsafe mode"
|
#define TR_FAILSAFE INDENT "Failsafe mode"
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Path too long"
|
#define TR_PATH_TOO_LONG "Path too long"
|
||||||
#define TR_VIEW_TEXT "View text"
|
#define TR_VIEW_TEXT "View text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Interna RF"
|
#define TR_INTERNALRF "Interna RF"
|
||||||
#define TR_EXTERNALRF "Externa RF"
|
#define TR_EXTERNALRF "Externa RF"
|
||||||
#define TR_FAILSAFE INDENT"Modo sgdad."
|
#define TR_FAILSAFE INDENT"Modo sgdad."
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Path too long"
|
#define TR_PATH_TOO_LONG "Path too long"
|
||||||
#define TR_VIEW_TEXT "View text"
|
#define TR_VIEW_TEXT "View text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Internal RF"
|
#define TR_INTERNALRF "Internal RF"
|
||||||
#define TR_EXTERNALRF "External RF"
|
#define TR_EXTERNALRF "External RF"
|
||||||
#define TR_FAILSAFE INDENT "Failsafe mode"
|
#define TR_FAILSAFE INDENT "Failsafe mode"
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Chemin trop long"
|
#define TR_PATH_TOO_LONG "Chemin trop long"
|
||||||
#define TR_VIEW_TEXT "Voir texte"
|
#define TR_VIEW_TEXT "Voir texte"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "HF interne"
|
#define TR_INTERNALRF "HF interne"
|
||||||
#define TR_EXTERNALRF "HF externe"
|
#define TR_EXTERNALRF "HF externe"
|
||||||
#define TR_FAILSAFE INDENT "Type failsafe"
|
#define TR_FAILSAFE INDENT "Type failsafe"
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Path too long"
|
#define TR_PATH_TOO_LONG "Path too long"
|
||||||
#define TR_VIEW_TEXT "View text"
|
#define TR_VIEW_TEXT "View text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Modulo Interno"
|
#define TR_INTERNALRF "Modulo Interno"
|
||||||
#define TR_EXTERNALRF "Modulo esterno"
|
#define TR_EXTERNALRF "Modulo esterno"
|
||||||
#define TR_FAILSAFE "Modo failsafe"
|
#define TR_FAILSAFE "Modo failsafe"
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Ścieżka za długa"
|
#define TR_PATH_TOO_LONG "Ścieżka za długa"
|
||||||
#define TR_VIEW_TEXT "Pokaż tekst"
|
#define TR_VIEW_TEXT "Pokaż tekst"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Wewnętrzny moduł RF"
|
#define TR_INTERNALRF "Wewnętrzny moduł RF"
|
||||||
#define TR_EXTERNALRF "Zewnętrzny moduł RF"
|
#define TR_EXTERNALRF "Zewnętrzny moduł RF"
|
||||||
#define TR_FAILSAFE "Tryb Failsafe"
|
#define TR_FAILSAFE "Tryb Failsafe"
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "Path too long"
|
#define TR_PATH_TOO_LONG "Path too long"
|
||||||
#define TR_VIEW_TEXT "View text"
|
#define TR_VIEW_TEXT "View text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Internal RF"
|
#define TR_INTERNALRF "Internal RF"
|
||||||
#define TR_EXTERNALRF "External RF"
|
#define TR_EXTERNALRF "External RF"
|
||||||
#define TR_FAILSAFE "Failsafe mode"
|
#define TR_FAILSAFE "Failsafe mode"
|
||||||
|
|
|
@ -713,6 +713,8 @@
|
||||||
#define TR_PATH_TOO_LONG "För lång sökväg"
|
#define TR_PATH_TOO_LONG "För lång sökväg"
|
||||||
#define TR_VIEW_TEXT "Visa Text"
|
#define TR_VIEW_TEXT "Visa Text"
|
||||||
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
#define TR_FLASH_BOOTLOADER "Flash BootLoader"
|
||||||
|
#define TR_WRITING "\032Writing..."
|
||||||
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Intern Radio"
|
#define TR_INTERNALRF "Intern Radio"
|
||||||
#define TR_EXTERNALRF "Extern Radiomodul"
|
#define TR_EXTERNALRF "Extern Radiomodul"
|
||||||
#define TR_FAILSAFE "Failsafeläge"
|
#define TR_FAILSAFE "Failsafeläge"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue