diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 482442cb53..9dabe2c733 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -141,7 +141,7 @@ long gui_wps_show(void) if (wps_state.paused) { settings_save(); #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) - call_ata_idle_notifys(false); + call_ata_idle_notifys(true); #endif } } @@ -255,7 +255,7 @@ long gui_wps_show(void) audio_pause(); settings_save(); #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) - call_ata_idle_notifys(false); /* make sure resume info is saved */ + call_ata_idle_notifys(true); /* make sure resume info is saved */ #endif } break; diff --git a/apps/misc.c b/apps/misc.c index 709bc49208..2f3251431b 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -555,7 +555,7 @@ bool settings_parseline(char* line, char** name, char** value) static void system_flush(void) { - call_ata_idle_notifys(false); /*doesnt work on usb and shutdown from ata thread */ + call_ata_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */ tree_flush(); } @@ -569,7 +569,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) #ifdef SIMULATOR (void)callback; (void)parameter; - call_ata_idle_notifys(false); + call_ata_idle_notifys(true); exit(0); #else int i; diff --git a/firmware/ata_idle_notify.c b/firmware/ata_idle_notify.c index c51c3800ce..17adbc1192 100644 --- a/firmware/ata_idle_notify.c +++ b/firmware/ata_idle_notify.c @@ -20,7 +20,7 @@ #include "system.h" #include "ata.h" #include "ata_idle_notify.h" -#include "logf.h" +#include "kernel.h" #include "string.h" #if USING_ATA_CALLBACK @@ -28,10 +28,13 @@ static ata_idle_notify ata_idle_notify_funcs[MAX_ATA_CALLBACKS]; static int ata_callback_count = 0; #endif + bool register_ata_idle_func(ata_idle_notify function) { #if USING_ATA_CALLBACK int i; + if (ata_callback_count >= MAX_ATA_CALLBACKS) + return false; for (i=0; i