diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2006-12-06 12:11:57 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2006-12-06 12:11:57 +0000 |
commit | 3e24665c417c2dd7dc292c9f12efae4e6544aa11 (patch) | |
tree | f769a05cd2ad2c4335dd9019c7cfbf787ceafe80 | |
parent | 761122dcff4158b68a0d3f977cff554c4e8365e3 (diff) | |
download | rockbox-3e24665c417c2dd7dc292c9f12efae4e6544aa11.tar.gz rockbox-3e24665c417c2dd7dc292c9f12efae4e6544aa11.zip |
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
-rw-r--r-- | apps/main.c | 1 | ||||
-rw-r--r-- | apps/main_menu.c | 1 | ||||
-rw-r--r-- | apps/playback.c | 2 | ||||
-rw-r--r-- | apps/settings.c | 8 | ||||
-rw-r--r-- | firmware/ata_idle_notify.c | 7 | ||||
-rw-r--r-- | firmware/drivers/ata.c | 2 |
6 files changed, 16 insertions, 5 deletions
diff --git a/apps/main.c b/apps/main.c index 753cd71e8d..bfc331dc88 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -162,6 +162,7 @@ int init_dircache(bool preinit) | |||
162 | { | 162 | { |
163 | backlight_on(); | 163 | backlight_on(); |
164 | show_logo(); | 164 | show_logo(); |
165 | settings_save(); | ||
165 | } | 166 | } |
166 | } | 167 | } |
167 | 168 | ||
diff --git a/apps/main_menu.c b/apps/main_menu.c index 0ac4d94753..f66f511e9c 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -435,7 +435,6 @@ bool main_menu(void) | |||
435 | #endif | 435 | #endif |
436 | menu_exit(m); | 436 | menu_exit(m); |
437 | 437 | ||
438 | settings_save(); | ||
439 | return result; | 438 | return result; |
440 | } | 439 | } |
441 | 440 | ||
diff --git a/apps/playback.c b/apps/playback.c index 02af5b6ec4..294bb3d69c 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -3560,7 +3560,7 @@ static void audio_thread(void) | |||
3560 | else | 3560 | else |
3561 | { | 3561 | { |
3562 | queue_wait_w_tmo(&audio_queue, &ev, HZ/2); | 3562 | queue_wait_w_tmo(&audio_queue, &ev, HZ/2); |
3563 | if ( (ev.id == SYS_TIMEOUT) && | 3563 | if (playing && (ev.id == SYS_TIMEOUT) && |
3564 | (FILEBUFUSED < high_watermark)) | 3564 | (FILEBUFUSED < high_watermark)) |
3565 | register_ata_idle_func(ata_fillbuffer_callback); | 3565 | register_ata_idle_func(ata_fillbuffer_callback); |
3566 | } | 3566 | } |
diff --git a/apps/settings.c b/apps/settings.c index 94d456fcf5..91ffc0d238 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -2086,6 +2086,14 @@ bool do_set_setting(const unsigned char* string, void *variable, | |||
2086 | if ( function ) | 2086 | if ( function ) |
2087 | function(type_fromvoidptr(cb_data->type,variable)); | 2087 | function(type_fromvoidptr(cb_data->type,variable)); |
2088 | } | 2088 | } |
2089 | if (cb_data->type == INT) | ||
2090 | { | ||
2091 | if (oldvalue != *(int*)variable) | ||
2092 | settings_save(); | ||
2093 | } | ||
2094 | else if (oldvalue != *(bool*)variable) | ||
2095 | settings_save(); | ||
2096 | |||
2089 | return false; | 2097 | return false; |
2090 | } | 2098 | } |
2091 | bool set_int(const unsigned char* string, | 2099 | bool set_int(const unsigned char* string, |
diff --git a/firmware/ata_idle_notify.c b/firmware/ata_idle_notify.c index 17adbc1192..1fc6605ac6 100644 --- a/firmware/ata_idle_notify.c +++ b/firmware/ata_idle_notify.c | |||
@@ -77,8 +77,11 @@ bool call_ata_idle_notifys(bool force) | |||
77 | int i; | 77 | int i; |
78 | static int lock_until = 0; | 78 | static int lock_until = 0; |
79 | ata_idle_notify function; | 79 | ata_idle_notify function; |
80 | if (!force && TIME_BEFORE(current_tick,lock_until) ) | 80 | if (!force) |
81 | return false; | 81 | { |
82 | if (TIME_BEFORE(current_tick,lock_until) ) | ||
83 | return false; | ||
84 | } | ||
82 | lock_until = current_tick + 30*HZ; | 85 | lock_until = current_tick + 30*HZ; |
83 | 86 | ||
84 | for (i = 0; i < MAX_ATA_CALLBACKS; i++) | 87 | for (i = 0; i < MAX_ATA_CALLBACKS; i++) |
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 72194db8da..5e69b36f2d 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -614,7 +614,7 @@ static void ata_thread(void) | |||
614 | TIME_AFTER( current_tick, | 614 | TIME_AFTER( current_tick, |
615 | last_disk_activity + sleep_timeout ) ) | 615 | last_disk_activity + sleep_timeout ) ) |
616 | { | 616 | { |
617 | call_ata_idle_notifys(false); | 617 | call_ata_idle_notifys(true); |
618 | ata_perform_sleep(); | 618 | ata_perform_sleep(); |
619 | last_sleep = current_tick; | 619 | last_sleep = current_tick; |
620 | } | 620 | } |