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:
@@ -692,10 +692,10 @@ void flashBootloader(const char * filename)
|
||||
f_open(&file, filename, FA_READ);
|
||||
uint8_t buffer[1024];
|
||||
UINT count;
|
||||
|
||||
lcd_clear();
|
||||
lcd_putsLeft(4*FH, "\032Writing...");
|
||||
lcd_putsLeft(4*FH, STR_WRITING);
|
||||
lcd_rect(3, 6*FH+4, 204, 7);
|
||||
watchdogSetTimeout(1000/*10s*/);
|
||||
|
||||
static uint8_t unlocked = 0;
|
||||
if (!unlocked) {
|
||||
@@ -704,12 +704,13 @@ void flashBootloader(const char * filename)
|
||||
}
|
||||
|
||||
for (int i=0; i<BOOTLOADER_SIZE; i+=1024) {
|
||||
watchdogSetTimeout(100/*1s*/);
|
||||
if (f_read(&file, buffer, 1024, &count) != FR_OK || count != 1024) {
|
||||
// TODO popup error
|
||||
POPUP_WARNING(STR_SDCARD_ERROR);
|
||||
break;
|
||||
}
|
||||
if (i==0 && !isBootloaderStart((uint32_t *)buffer)) {
|
||||
// TODO popup error
|
||||
POPUP_WARNING(STR_INCOMPATIBLE);
|
||||
break;
|
||||
}
|
||||
for (int j=0; j<1024; j+=FLASH_PAGESIZE) {
|
||||
@@ -733,7 +734,7 @@ void onSdManagerMenu(const char *result)
|
||||
pushMenu(menuGeneralSdManagerInfo);
|
||||
}
|
||||
else if (result == STR_SD_FORMAT) {
|
||||
POPUP_CONFIRMATION(PSTR("Confirm Format?"));
|
||||
POPUP_CONFIRMATION(STR_CONFIRM_FORMAT);
|
||||
}
|
||||
else if (result == STR_DELETE_FILE) {
|
||||
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_type;
|
||||
uint8_t s_warning_result = 0;
|
||||
const pm_char * s_global_warning = NULL;
|
||||
|
||||
#if defined(CPUARM)
|
||||
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_type;
|
||||
|
||||
extern const pm_char * s_global_warning;
|
||||
|
||||
#define WARNING_LINE_X 16
|
||||
#define WARNING_LINE_Y 3*FH
|
||||
#if LCD_W >= 212
|
||||
|
||||
@@ -499,13 +499,8 @@ void menuMainView(uint8_t event)
|
||||
uint8_t view_base = view & 0x0f;
|
||||
#endif
|
||||
|
||||
uint8_t _event = event;
|
||||
if (s_global_warning) {
|
||||
event = 0;
|
||||
}
|
||||
switch(event) {
|
||||
|
||||
switch(event)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
killEvents(KEY_EXIT);
|
||||
killEvents(KEY_UP);
|
||||
@@ -637,16 +632,13 @@ void menuMainView(uint8_t event)
|
||||
return;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
if (s_global_warning) {
|
||||
s_global_warning = NULL;
|
||||
}
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
else if (s_gvar_timer > 0) {
|
||||
if (s_gvar_timer > 0) {
|
||||
s_gvar_timer = 0;
|
||||
}
|
||||
#endif
|
||||
#if !defined(PCBTARANIS)
|
||||
else if (view == VIEW_TIMER2) {
|
||||
if (view == VIEW_TIMER2) {
|
||||
resetTimer(1);
|
||||
}
|
||||
#endif
|
||||
@@ -871,15 +863,8 @@ void menuMainView(uint8_t event)
|
||||
}
|
||||
#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)
|
||||
else if (s_gvar_timer > 0) {
|
||||
if (s_gvar_timer > 0) {
|
||||
s_gvar_timer--;
|
||||
#if LCD_W >= 212
|
||||
lcd_filled_rect(BITMAP_X, BITMAP_Y, 64, 32, SOLID, ERASE);
|
||||
|
||||
Reference in New Issue
Block a user