Fix settings not saving to disk correctly, (fixes FS#6408)

Stop playback.c requesting a rebuffer while not playing
Shutting down from inside the menu will now save settings to disk, and
entering the main menu will not force a setting save unless a setting
actually changes


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11674 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2006-12-06 12:11:57 +00:00
parent 761122dcff
commit 3e24665c41
6 changed files with 16 additions and 5 deletions

View file

@ -162,6 +162,7 @@ int init_dircache(bool preinit)
{ {
backlight_on(); backlight_on();
show_logo(); show_logo();
settings_save();
} }
} }

View file

@ -435,7 +435,6 @@ bool main_menu(void)
#endif #endif
menu_exit(m); menu_exit(m);
settings_save();
return result; return result;
} }

View file

@ -3560,7 +3560,7 @@ static void audio_thread(void)
else else
{ {
queue_wait_w_tmo(&audio_queue, &ev, HZ/2); queue_wait_w_tmo(&audio_queue, &ev, HZ/2);
if ( (ev.id == SYS_TIMEOUT) && if (playing && (ev.id == SYS_TIMEOUT) &&
(FILEBUFUSED < high_watermark)) (FILEBUFUSED < high_watermark))
register_ata_idle_func(ata_fillbuffer_callback); register_ata_idle_func(ata_fillbuffer_callback);
} }

View file

@ -2086,6 +2086,14 @@ bool do_set_setting(const unsigned char* string, void *variable,
if ( function ) if ( function )
function(type_fromvoidptr(cb_data->type,variable)); function(type_fromvoidptr(cb_data->type,variable));
} }
if (cb_data->type == INT)
{
if (oldvalue != *(int*)variable)
settings_save();
}
else if (oldvalue != *(bool*)variable)
settings_save();
return false; return false;
} }
bool set_int(const unsigned char* string, bool set_int(const unsigned char* string,

View file

@ -77,8 +77,11 @@ bool call_ata_idle_notifys(bool force)
int i; int i;
static int lock_until = 0; static int lock_until = 0;
ata_idle_notify function; ata_idle_notify function;
if (!force && TIME_BEFORE(current_tick,lock_until) ) if (!force)
{
if (TIME_BEFORE(current_tick,lock_until) )
return false; return false;
}
lock_until = current_tick + 30*HZ; lock_until = current_tick + 30*HZ;
for (i = 0; i < MAX_ATA_CALLBACKS; i++) for (i = 0; i < MAX_ATA_CALLBACKS; i++)

View file

@ -614,7 +614,7 @@ static void ata_thread(void)
TIME_AFTER( current_tick, TIME_AFTER( current_tick,
last_disk_activity + sleep_timeout ) ) last_disk_activity + sleep_timeout ) )
{ {
call_ata_idle_notifys(false); call_ata_idle_notifys(true);
ata_perform_sleep(); ata_perform_sleep();
last_sleep = current_tick; last_sleep = current_tick;
} }