summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/menus/playback_menu.c9
-rw-r--r--apps/menus/settings_menu.c6
-rw-r--r--apps/playback.c5
-rw-r--r--apps/playlist.c2
-rw-r--r--apps/plugins/battery_bench.c10
-rw-r--r--apps/plugins/jpeg.c4
-rw-r--r--apps/plugins/video.c7
-rw-r--r--apps/settings.c4
-rw-r--r--apps/settings.h3
-rw-r--r--apps/settings_list.c6
-rw-r--r--firmware/export/audio.h2
-rw-r--r--firmware/export/config-e200.h3
-rw-r--r--firmware/export/config-ifp7xx.h3
-rw-r--r--firmware/export/config-ipodnano.h3
-rw-r--r--firmware/export/config-ondiofm.h3
-rw-r--r--firmware/export/config-ondiosp.h3
-rw-r--r--firmware/mpeg.c4
17 files changed, 62 insertions, 15 deletions
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c
index 1f6c96e421..c1de862cd0 100644
--- a/apps/menus/playback_menu.c
+++ b/apps/menus/playback_menu.c
@@ -62,6 +62,7 @@ MENUITEM_SETTING(ff_rewind_accel, &global_settings.ff_rewind_accel, NULL);
62MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL); 62MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL);
63MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON, 63MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON,
64 &ff_rewind_min_step, &ff_rewind_accel); 64 &ff_rewind_min_step, &ff_rewind_accel);
65#ifndef HAVE_FLASH_STORAGE
65#if CONFIG_CODEC == SWCODEC 66#if CONFIG_CODEC == SWCODEC
66int buffermargin_callback(int action,const struct menu_item_ex *this_item) 67int buffermargin_callback(int action,const struct menu_item_ex *this_item)
67{ 68{
@@ -79,6 +80,7 @@ int buffermargin_callback(int action,const struct menu_item_ex *this_item)
79#endif 80#endif
80MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin, 81MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin,
81 buffermargin_callback); 82 buffermargin_callback);
83#endif /*HAVE_FLASH_STORAGE */
82MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL); 84MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL);
83MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL); 85MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL);
84 86
@@ -172,8 +174,11 @@ MAKE_MENU(unplug_menu, ID2P(LANG_UNPLUG), 0, Icon_NOICON,
172MAKE_MENU(playback_menu_item,ID2P(LANG_PLAYBACK),0, 174MAKE_MENU(playback_menu_item,ID2P(LANG_PLAYBACK),0,
173 Icon_Playback_menu, 175 Icon_Playback_menu,
174 &shuffle_item, &repeat_mode, &play_selected, 176 &shuffle_item, &repeat_mode, &play_selected,
175 &ff_rewind_settings_menu, 177 &ff_rewind_settings_menu,
176 &buffer_margin, &fade_on_stop, &party_mode, 178#ifndef HAVE_FLASH_STORAGE
179 &buffer_margin,
180#endif
181 &fade_on_stop, &party_mode,
177 182
178#if CONFIG_CODEC == SWCODEC 183#if CONFIG_CODEC == SWCODEC
179 &crossfade_settings_menu, &replaygain_settings_menu, &beep, 184 &crossfade_settings_menu, &replaygain_settings_menu, &beep,
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 302a7428aa..2a68f80c79 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -160,8 +160,9 @@ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON,
160 ); 160 );
161#endif /* SIMULATOR */ 161#endif /* SIMULATOR */
162/* Disk */ 162/* Disk */
163#ifndef HAVE_MMC 163#ifndef HAVE_FLASH_STORAGE
164MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL); 164MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
165#endif
165#ifdef HAVE_DIRCACHE 166#ifdef HAVE_DIRCACHE
166static int dircache_callback(int action,const struct menu_item_ex *this_item) 167static int dircache_callback(int action,const struct menu_item_ex *this_item)
167{ 168{
@@ -186,8 +187,11 @@ static int dircache_callback(int action,const struct menu_item_ex *this_item)
186} 187}
187MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback); 188MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback);
188#endif 189#endif
190#if defined(HAVE_DIRCACHE) || !defined(HAVE_FLASH_STORAGE)
189MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON, 191MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON,
192#ifndef HAVE_FLASH_STORAGE
190 &disk_spindown, 193 &disk_spindown,
194#endif
191#ifdef HAVE_DIRCACHE 195#ifdef HAVE_DIRCACHE
192 &dircache, 196 &dircache,
193#endif 197#endif
diff --git a/apps/playback.c b/apps/playback.c
index 0533ddcf4c..7b9b664e9c 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -792,6 +792,7 @@ int audio_get_file_pos(void)
792 return 0; 792 return 0;
793} 793}
794 794
795#ifndef HAVE_FLASH_STORAGE
795void audio_set_buffer_margin(int setting) 796void audio_set_buffer_margin(int setting)
796{ 797{
797 static const int lookup[] = {5, 15, 30, 60, 120, 180, 300, 600}; 798 static const int lookup[] = {5, 15, 30, 60, 120, 180, 300, 600};
@@ -799,6 +800,7 @@ void audio_set_buffer_margin(int setting)
799 logf("buffer margin: %ld", buffer_margin); 800 logf("buffer margin: %ld", buffer_margin);
800 set_filebuf_watermark(buffer_margin); 801 set_filebuf_watermark(buffer_margin);
801} 802}
803#endif
802 804
803/* Take nescessary steps to enable or disable the crossfade setting */ 805/* Take nescessary steps to enable or disable the crossfade setting */
804void audio_set_crossfade(int enable) 806void audio_set_crossfade(int enable)
@@ -3839,5 +3841,8 @@ void audio_init(void)
3839#ifdef HAVE_WM8758 3841#ifdef HAVE_WM8758
3840 eq_hw_enable(global_settings.eq_hw_enabled); 3842 eq_hw_enable(global_settings.eq_hw_enabled);
3841#endif 3843#endif
3844#ifndef HAVE_FLASH_STORAGE
3842 audio_set_buffer_margin(global_settings.buffer_margin); 3845 audio_set_buffer_margin(global_settings.buffer_margin);
3846#endif
3843} /* audio_init */ 3847} /* audio_init */
3848
diff --git a/apps/playlist.c b/apps/playlist.c
index f0ac29d1ef..39d7cc1e3d 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -1172,9 +1172,11 @@ static void playlist_thread(void)
1172 1172
1173 int sleep_time = 5; 1173 int sleep_time = 5;
1174 1174
1175#ifndef HAVE_FLASH_STORAGE
1175 if (global_settings.disk_spindown > 1 && 1176 if (global_settings.disk_spindown > 1 &&
1176 global_settings.disk_spindown <= 5) 1177 global_settings.disk_spindown <= 5)
1177 sleep_time = global_settings.disk_spindown - 1; 1178 sleep_time = global_settings.disk_spindown - 1;
1179#endif
1178 1180
1179 while (1) 1181 while (1)
1180 { 1182 {
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 3d8eadb639..8c71f0ecce 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -188,15 +188,17 @@ void thread(void)
188#if CONFIG_CHARGING || defined(HAVE_USB_POWER) 188#if CONFIG_CHARGING || defined(HAVE_USB_POWER)
189 unsigned int last_state = 0; 189 unsigned int last_state = 0;
190#endif 190#endif
191 long sleep_time; 191 long sleep_time = 5 * HZ;
192 192
193 struct event ev; 193 struct event ev;
194 194
195 buffelements = sizeof(bat)/sizeof(struct batt_info); 195 buffelements = sizeof(bat)/sizeof(struct batt_info);
196 196
197 sleep_time = (rb->global_settings->disk_spindown > 1) ? 197#ifndef HAVE_FLASH_STORAGE
198 (rb->global_settings->disk_spindown - 1) * HZ : 5 * HZ; 198 if(rb->global_settings->disk_spindown > 1)
199 199 sleep_time = (rb->global_settings->disk_spindown - 1) * HZ;
200#endif
201
200 do 202 do
201 { 203 {
202 if(!in_usb_mode && got_info && 204 if(!in_usb_mode && got_info &&
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index 54c8c6cb63..ad56475ebc 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -2541,7 +2541,7 @@ int show_menu(void) /* return 1 to quit */
2541 break; 2541 break;
2542 } 2542 }
2543 2543
2544#ifndef SIMULATOR 2544#if !defined(SIMULATOR) && !defined(HAVE_FLASH_STORAGE)
2545 /* change ata spindown time based on slideshow time setting */ 2545 /* change ata spindown time based on slideshow time setting */
2546 immediate_ata_off = false; 2546 immediate_ata_off = false;
2547 rb->ata_spindown(rb->global_settings->disk_spindown); 2547 rb->ata_spindown(rb->global_settings->disk_spindown);
@@ -3325,7 +3325,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
3325 } 3325 }
3326#endif 3326#endif
3327 3327
3328#ifndef SIMULATOR 3328#if !defined(SIMULATOR) && !defined(HAVE_FLASH_STORAGE)
3329 /* set back ata spindown time in case we changed it */ 3329 /* set back ata spindown time in case we changed it */
3330 rb->ata_spindown(rb->global_settings->disk_spindown); 3330 rb->ata_spindown(rb->global_settings->disk_spindown);
3331#endif 3331#endif
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index b56a9d0612..aca960f56e 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -650,8 +650,11 @@ int PlayTick(int fd)
650 * gFileHdr.bps_peak / 8 / HZ; 650 * gFileHdr.bps_peak / 8 / HZ;
651 } 651 }
652 652
653 if (!gPlay.bRefilling 653 if (!gPlay.bRefilling
654 && rb->global_settings->disk_spindown < 20) /* condition for test only */ 654#ifndef HAVE_FLASH_STORAGE
655 && rb->global_settings->disk_spindown < 20 /* condition for test only */
656#endif
657 )
655 { 658 {
656 rb->ata_sleep(); /* no point in leaving the disk run til timeout */ 659 rb->ata_sleep(); /* no point in leaving the disk run til timeout */
657 gPlay.bDiskSleep = true; 660 gPlay.bDiskSleep = true;
diff --git a/apps/settings.c b/apps/settings.c
index 0cf38266a6..958c410af8 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -658,7 +658,9 @@ void settings_apply(void)
658 DEBUGF( "settings_apply()\n" ); 658 DEBUGF( "settings_apply()\n" );
659 sound_settings_apply(); 659 sound_settings_apply();
660 660
661#ifndef HAVE_FLASH_STORAGE
661 audio_set_buffer_margin(global_settings.buffer_margin); 662 audio_set_buffer_margin(global_settings.buffer_margin);
663#endif
662 664
663#ifdef HAVE_LCD_CONTRAST 665#ifdef HAVE_LCD_CONTRAST
664 lcd_set_contrast(global_settings.contrast); 666 lcd_set_contrast(global_settings.contrast);
@@ -702,7 +704,9 @@ void settings_apply(void)
702#ifdef HAVE_BUTTON_LIGHT 704#ifdef HAVE_BUTTON_LIGHT
703 button_backlight_set_timeout(global_settings.button_light_timeout); 705 button_backlight_set_timeout(global_settings.button_light_timeout);
704#endif 706#endif
707#ifndef HAVE_FLASH_STORAGE
705 ata_spindown(global_settings.disk_spindown); 708 ata_spindown(global_settings.disk_spindown);
709#endif
706#if (CONFIG_CODEC == MAS3507D) && !defined(SIMULATOR) 710#if (CONFIG_CODEC == MAS3507D) && !defined(SIMULATOR)
707 dac_line_in(global_settings.line_in); 711 dac_line_in(global_settings.line_in);
708#endif 712#endif
diff --git a/apps/settings.h b/apps/settings.h
index f9ee1df7ec..4d7073bf3b 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -446,8 +446,11 @@ struct user_settings
446 bool play_selected; /* Plays selected file even in shuffle mode */ 446 bool play_selected; /* Plays selected file even in shuffle mode */
447 int ff_rewind_min_step; /* FF/Rewind minimum step size */ 447 int ff_rewind_min_step; /* FF/Rewind minimum step size */
448 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */ 448 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
449
450#ifndef HAVE_FLASH_STORAGE
449 int disk_spindown; /* time until disk spindown, in seconds (0=off) */ 451 int disk_spindown; /* time until disk spindown, in seconds (0=off) */
450 int buffer_margin; /* MP3 buffer watermark margin, in seconds */ 452 int buffer_margin; /* MP3 buffer watermark margin, in seconds */
453#endif
451 454
452 int peak_meter_release; /* units per read out */ 455 int peak_meter_release; /* units per read out */
453 int peak_meter_hold; /* hold time for peak meter in 1/100 s */ 456 int peak_meter_hold; /* hold time for peak meter in 1/100 s */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 76a3e41b60..74b1610411 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -628,15 +628,15 @@ const struct settings_list settings[] = {
628 TALK_ID(5, UNIT_SEC), TALK_ID(15, UNIT_SEC), 628 TALK_ID(5, UNIT_SEC), TALK_ID(15, UNIT_SEC),
629 TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN), TALK_ID(2, UNIT_MIN), 629 TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN), TALK_ID(2, UNIT_MIN),
630 TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)), 630 TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)),
631#else 631#elif !defined(HAVE_FLASH_STORAGE)
632 INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip", 632 INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip",
633 UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin), 633 UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin),
634#endif 634#endif
635 /* disk */ 635 /* disk */
636#ifndef HAVE_MMC 636#ifndef HAVE_FLASH_STORAGE
637 INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown", 637 INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown",
638 UNIT_SEC, 3, 254, 1, NULL, NULL, ata_spindown), 638 UNIT_SEC, 3, 254, 1, NULL, NULL, ata_spindown),
639#endif /* HAVE_MMC */ 639#endif /* HAVE_FLASH_STORAGE */
640 /* browser */ 640 /* browser */
641 CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files", 641 CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files",
642 "all,supported,music,playlists", NULL, 4, ID2P(LANG_FILTER_ALL), 642 "all,supported,music,playlists", NULL, 4, ID2P(LANG_FILTER_ALL),
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index e6fed90069..933076537e 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -96,7 +96,9 @@ struct mp3entry* audio_next_track(void);
96bool audio_has_changed_track(void); 96bool audio_has_changed_track(void);
97void audio_get_debugdata(struct audio_debug *dbgdata); 97void audio_get_debugdata(struct audio_debug *dbgdata);
98void audio_set_crossfade(int type); 98void audio_set_crossfade(int type);
99#ifndef HAVE_FLASH_STORAGE
99void audio_set_buffer_margin(int seconds); 100void audio_set_buffer_margin(int seconds);
101#endif
100unsigned int audio_error(void); 102unsigned int audio_error(void);
101void audio_error_clear(void); 103void audio_error_clear(void);
102int audio_get_file_pos(void); 104int audio_get_file_pos(void);
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h
index bbf4ce0c81..b59974ad96 100644
--- a/firmware/export/config-e200.h
+++ b/firmware/export/config-e200.h
@@ -84,6 +84,9 @@
84 84
85#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ 85#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */
86 86
87/* define this if you have a flash memory storage */
88#define HAVE_FLASH_STORAGE
89
87/** Non-simulator section **/ 90/** Non-simulator section **/
88#ifndef SIMULATOR 91#ifndef SIMULATOR
89 92
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h
index 435b6ef984..89b2228078 100644
--- a/firmware/export/config-ifp7xx.h
+++ b/firmware/export/config-ifp7xx.h
@@ -57,6 +57,9 @@
57#define MAX_CONTRAST_SETTING 63 57#define MAX_CONTRAST_SETTING 63
58#define DEFAULT_CONTRAST_SETTING 40 58#define DEFAULT_CONTRAST_SETTING 40
59 59
60/* define this if you have a flash memory storage */
61#define HAVE_FLASH_STORAGE
62
60#ifndef SIMULATOR 63#ifndef SIMULATOR
61 64
62/* Define this if you have a Philips PNX0101 */ 65/* Define this if you have a Philips PNX0101 */
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index edf7f2dea2..546d9b85fc 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -70,6 +70,9 @@
70/* We can fade the backlight by using PWM */ 70/* We can fade the backlight by using PWM */
71#define HAVE_BACKLIGHT_PWM_FADING 71#define HAVE_BACKLIGHT_PWM_FADING
72 72
73/* define this if you have a flash memory storage */
74#define HAVE_FLASH_STORAGE
75
73#ifndef SIMULATOR 76#ifndef SIMULATOR
74 77
75/* Define this if you have a PortalPlayer PP5022 */ 78/* Define this if you have a PortalPlayer PP5022 */
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index ea806a4973..93c0fccc8c 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -48,6 +48,9 @@
48 48
49#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ 49#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */
50 50
51/* define this if you have a flash memory storage */
52#define HAVE_FLASH_STORAGE
53
51#ifndef SIMULATOR 54#ifndef SIMULATOR
52 55
53/* Define this if you have a SH7034 */ 56/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index 1d3e98ac0a..22673e82b3 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -37,6 +37,9 @@
37 37
38#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ 38#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */
39 39
40/* define this if you have a flash memory storage */
41#define HAVE_FLASH_STORAGE
42
40#ifndef SIMULATOR 43#ifndef SIMULATOR
41 44
42/* Define this if you have a SH7034 */ 45/* Define this if you have a SH7034 */
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 4ba3f7ead7..278eea4758 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -158,7 +158,7 @@ static int last_dma_tick = 0;
158static int last_dma_chunk_size; 158static int last_dma_chunk_size;
159 159
160static long low_watermark; /* Dynamic low watermark level */ 160static long low_watermark; /* Dynamic low watermark level */
161static long low_watermark_margin; /* Extra time in seconds for watermark */ 161static long low_watermark_margin = 0; /* Extra time in seconds for watermark */
162static long lowest_watermark_level; /* Debug value to observe the buffer 162static long lowest_watermark_level; /* Debug value to observe the buffer
163 usage */ 163 usage */
164#if CONFIG_CODEC == MAS3587F 164#if CONFIG_CODEC == MAS3587F
@@ -592,10 +592,12 @@ static void recalculate_watermark(int bitrate)
592 } 592 }
593} 593}
594 594
595#ifndef HAVE_FLASH_STORAGE
595void audio_set_buffer_margin(int seconds) 596void audio_set_buffer_margin(int seconds)
596{ 597{
597 low_watermark_margin = seconds; 598 low_watermark_margin = seconds;
598} 599}
600#endif
599 601
600void audio_get_debugdata(struct audio_debug *dbgdata) 602void audio_get_debugdata(struct audio_debug *dbgdata)
601{ 603{