summaryrefslogtreecommitdiff
path: root/apps/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/misc.c')
-rw-r--r--apps/misc.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/apps/misc.c b/apps/misc.c
index ff05819a4d..b0c315af98 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -49,6 +49,7 @@
49#include "ata_mmc.h" 49#include "ata_mmc.h"
50#endif 50#endif
51#include "tree.h" 51#include "tree.h"
52#include "eeprom_settings.h"
52 53
53#ifdef HAVE_LCD_BITMAP 54#ifdef HAVE_LCD_BITMAP
54#include "bmp.h" 55#include "bmp.h"
@@ -484,13 +485,6 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
484#else 485#else
485 int i; 486 int i;
486 487
487 if (tagcache_get_commit_step() > 0)
488 {
489 cancel_shutdown();
490 gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY));
491 return false;
492 }
493
494#if defined(CONFIG_CHARGING) && !defined(HAVE_POWEROFF_WHILE_CHARGING) 488#if defined(CONFIG_CHARGING) && !defined(HAVE_POWEROFF_WHILE_CHARGING)
495 if(!charger_inserted()) 489 if(!charger_inserted())
496#endif 490#endif
@@ -498,11 +492,26 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
498 FOR_NB_SCREENS(i) 492 FOR_NB_SCREENS(i)
499 screens[i].clear_display(); 493 screens[i].clear_display();
500 gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN)); 494 gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN));
495
496 if (!tagcache_prepare_shutdown())
497 {
498 cancel_shutdown();
499 gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY));
500 return false;
501 }
502
501 if (callback != NULL) 503 if (callback != NULL)
502 callback(parameter); 504 callback(parameter);
503 505
504 system_flush(); 506 system_flush();
505 507#ifdef HAVE_EEPROM
508 if (firmware_settings.initialized)
509 {
510 firmware_settings.disk_clean = true;
511 firmware_settings.bl_version = 0;
512 eeprom_settings_store();
513 }
514#endif
506 shutdown_hw(); 515 shutdown_hw();
507 } 516 }
508#endif 517#endif