diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2008-11-01 16:14:28 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2008-11-01 16:14:28 +0000 |
commit | 2f8a0081c64534da23fc0fa9cc685eb7454fd9c9 (patch) | |
tree | 84dbdbd5326cb48f43d2ebd5a4c86e992c1d5288 /apps/recorder/pcm_record.c | |
parent | 646cac0bde7b11fa7bcb670d1d76eec78e360485 (diff) | |
download | rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.tar.gz rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.zip |
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
Diffstat (limited to 'apps/recorder/pcm_record.c')
-rw-r--r-- | apps/recorder/pcm_record.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c index da4e9b7255..dbbc6901ec 100644 --- a/apps/recorder/pcm_record.c +++ b/apps/recorder/pcm_record.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "logf.h" | 24 | #include "logf.h" |
25 | #include "thread.h" | 25 | #include "thread.h" |
26 | #include <string.h> | 26 | #include <string.h> |
27 | #include "ata.h" | 27 | #include "storage.h" |
28 | #include "usb.h" | 28 | #include "usb.h" |
29 | #include "buffer.h" | 29 | #include "buffer.h" |
30 | #include "general.h" | 30 | #include "general.h" |
@@ -162,7 +162,7 @@ static bool pcm_buffer_empty; /* all pcm chunks processed? */ | |||
162 | static int low_watermark; /* Low watermark to stop flush */ | 162 | static int low_watermark; /* Low watermark to stop flush */ |
163 | static int high_watermark; /* max chunk limit for data flush */ | 163 | static int high_watermark; /* max chunk limit for data flush */ |
164 | static unsigned long spinup_time = 35*HZ/10; /* Fudged spinup time */ | 164 | static unsigned long spinup_time = 35*HZ/10; /* Fudged spinup time */ |
165 | static int last_ata_spinup_time = -1;/* previous spin time used */ | 165 | static int last_storage_spinup_time = -1;/* previous spin time used */ |
166 | #ifdef HAVE_PRIORITY_SCHEDULING | 166 | #ifdef HAVE_PRIORITY_SCHEDULING |
167 | static int flood_watermark; /* boost thread priority when here */ | 167 | static int flood_watermark; /* boost thread priority when here */ |
168 | #endif | 168 | #endif |
@@ -731,7 +731,7 @@ static void pcmrec_end_file(void) | |||
731 | */ | 731 | */ |
732 | static void pcmrec_refresh_watermarks(void) | 732 | static void pcmrec_refresh_watermarks(void) |
733 | { | 733 | { |
734 | logf("ata spinup: %d", ata_spinup_time); | 734 | logf("ata spinup: %d", storage_spinup_time()); |
735 | 735 | ||
736 | /* set the low mark for when flushing stops if automatic */ | 736 | /* set the low mark for when flushing stops if automatic */ |
737 | low_watermark = (LOW_SECONDS*4*sample_rate + (enc_chunk_size-1)) | 737 | low_watermark = (LOW_SECONDS*4*sample_rate + (enc_chunk_size-1)) |
@@ -755,7 +755,7 @@ static void pcmrec_refresh_watermarks(void) | |||
755 | 755 | ||
756 | logf("flood at: %d", flood_watermark); | 756 | logf("flood at: %d", flood_watermark); |
757 | #endif | 757 | #endif |
758 | spinup_time = last_ata_spinup_time = ata_spinup_time; | 758 | spinup_time = last_storage_spinup_time = storage_spinup_time(); |
759 | 759 | ||
760 | /* write at 8s + st remaining in enc_buffer - range 12s to | 760 | /* write at 8s + st remaining in enc_buffer - range 12s to |
761 | 20s total - default to 3.5s spinup. */ | 761 | 20s total - default to 3.5s spinup. */ |
@@ -816,7 +816,7 @@ static void pcmrec_flush(unsigned flush_num) | |||
816 | if (!is_recording) | 816 | if (!is_recording) |
817 | return; | 817 | return; |
818 | 818 | ||
819 | if (ata_spinup_time != last_ata_spinup_time) | 819 | if (storage_spinup_time() != last_storage_spinup_time) |
820 | pcmrec_refresh_watermarks(); | 820 | pcmrec_refresh_watermarks(); |
821 | 821 | ||
822 | /* enough available? no? then leave */ | 822 | /* enough available? no? then leave */ |