From 2f8a0081c64534da23fc0fa9cc685eb7454fd9c9 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 1 Nov 2008 16:14:28 +0000 Subject: Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*. This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/battery_bench.c | 4 ++-- apps/plugins/clock/clock_settings.c | 2 +- apps/plugins/jpeg/jpeg.c | 8 ++++---- apps/plugins/mpegplayer/disk_buf.c | 6 +++--- apps/plugins/mpegplayer/stream_mgr.h | 2 +- apps/plugins/video.c | 2 +- apps/plugins/wavplay.c | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index ef4795a0e1..fff93b2a3a 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -344,7 +344,7 @@ void thread(void) bat[buf_idx].flags = charge_state(); #endif buf_idx++; - rb->register_ata_idle_func(flush_buffer); + rb->register_storage_idle_func(flush_buffer); } /* What to do when the measurement buffer is full: @@ -386,7 +386,7 @@ void thread(void) } /* unregister flush callback and flush to disk */ - rb->unregister_ata_idle_func(flush_buffer, true); + rb->unregister_storage_idle_func(flush_buffer, true); /* log end of bench and exit reason */ fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND); diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c index 44a6f164a7..1147055ce5 100644 --- a/apps/plugins/clock/clock_settings.c +++ b/apps/plugins/clock/clock_settings.c @@ -173,7 +173,7 @@ void load_settings(void){ draw_message(display, MESSAGE_ERRLOAD, 1); display->update(); } - rb->ata_sleep(); + rb->storage_sleep(); rb->sleep(HZ); } diff --git a/apps/plugins/jpeg/jpeg.c b/apps/plugins/jpeg/jpeg.c index ed1b181e92..d8775dd176 100644 --- a/apps/plugins/jpeg/jpeg.c +++ b/apps/plugins/jpeg/jpeg.c @@ -438,14 +438,14 @@ int show_menu(void) /* return 1 to quit */ #if !defined(SIMULATOR) && defined(HAVE_DISK_STORAGE) /* change ata spindown time based on slideshow time setting */ immediate_ata_off = false; - rb->ata_spindown(rb->global_settings->disk_spindown); + rb->storage_spindown(rb->global_settings->disk_spindown); if (slideshow_enabled) { if(jpeg_settings.ss_timeout < 10) { /* slideshow times < 10s keep disk spinning */ - rb->ata_spindown(0); + rb->storage_spindown(0); } else if (!rb->mp3_is_playing()) { @@ -1057,7 +1057,7 @@ int load_and_show(char* filename) else if(immediate_ata_off) { /* running slideshow and time is long enough: power down disk */ - rb->ata_sleep(); + rb->storage_sleep(); } #endif @@ -1259,7 +1259,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame #if !defined(SIMULATOR) && defined(HAVE_DISK_STORAGE) /* set back ata spindown time in case we changed it */ - rb->ata_spindown(rb->global_settings->disk_spindown); + rb->storage_spindown(rb->global_settings->disk_spindown); #endif /* Turn on backlight timeout (revert to settings) */ diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index 7ba4025f1e..df5e005b50 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c @@ -171,7 +171,7 @@ static inline void disk_buf_buffer(void) if (!stream_get_window(&sw)) { disk_buf.state = TSTATE_DATA; - rb->ata_sleep(); + rb->storage_sleep(); break; } @@ -186,7 +186,7 @@ static inline void disk_buf_buffer(void) /* Free space is less than one page */ disk_buf.state = TSTATE_DATA; disk_buf.low_wm = DISK_BUF_LOW_WATERMARK; - rb->ata_sleep(); + rb->storage_sleep(); break; } @@ -208,7 +208,7 @@ static inline void disk_buf_buffer(void) { /* Error or end of stream */ disk_buf.state = TSTATE_EOS; - rb->ata_sleep(); + rb->storage_sleep(); break; } diff --git a/apps/plugins/mpegplayer/stream_mgr.h b/apps/plugins/mpegplayer/stream_mgr.h index c94fa84089..e3ea9207e6 100644 --- a/apps/plugins/mpegplayer/stream_mgr.h +++ b/apps/plugins/mpegplayer/stream_mgr.h @@ -153,7 +153,7 @@ static inline bool stream_can_seek(void) static inline void stream_keep_disk_active(void) { #ifdef HAVE_DISK_STORAGE - rb->ata_spin(); + rb->storage_spin(); #endif } diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 6a380b8e3c..1ba2b89e37 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -661,7 +661,7 @@ int PlayTick(int fd) #endif ) { - rb->ata_sleep(); /* no point in leaving the disk run til timeout */ + rb->storage_sleep(); /* no point in leaving the disk run til timeout */ gPlay.bDiskSleep = true; } diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c index c37b656d1c..dc0992abac 100644 --- a/apps/plugins/wavplay.c +++ b/apps/plugins/wavplay.c @@ -3598,7 +3598,7 @@ int play_file(char* filename) if (free_space <= 0) { filling = false; - rb->ata_sleep(); + rb->storage_sleep(); } else { -- cgit v1.2.3