diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-02-23 08:14:46 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2012-03-03 07:23:38 +0100 |
commit | 286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 (patch) | |
tree | 4835f46d16ec78d035ec9f49333079fe618384c1 /firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c | |
parent | 3f82f3aca14eb954e55f761721ffdd2684f0e812 (diff) | |
download | rockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.tar.gz rockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.zip |
Revise the PCM callback system after adding multichannel audio.
Additional status callback is added to pcm_play/rec_data instead of
using a special function to set it. Status includes DMA error
reporting to the status callback. Playback and recording callback
become more alike except playback uses "const void **addr" (because
the data should not be altered) and recording uses "void **addr".
"const" is put in place throughout where appropriate.
Most changes are fairly trivial. One that should be checked in
particular because it isn't so much is telechips, if anyone cares to
bother. PP5002 is not so trivial either but that tested as working.
Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2
Reviewed-on: http://gerrit.rockbox.org/166
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c')
-rw-r--r-- | firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c index 8b1fbf95e4..6e640bdf12 100644 --- a/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c +++ b/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c | |||
@@ -34,7 +34,7 @@ | |||
34 | /* This is global to save some latency when pcm_play_dma_get_peak_buffer is | 34 | /* This is global to save some latency when pcm_play_dma_get_peak_buffer is |
35 | * called. | 35 | * called. |
36 | */ | 36 | */ |
37 | static void *start; | 37 | static const void *start; |
38 | static int dma_channel; | 38 | static int dma_channel; |
39 | 39 | ||
40 | void pcm_play_dma_postinit(void) | 40 | void pcm_play_dma_postinit(void) |
@@ -171,9 +171,7 @@ void DSPHINT(void) | |||
171 | 171 | ||
172 | case MSG_REFILL: | 172 | case MSG_REFILL: |
173 | /* Buffer empty. Try to get more. */ | 173 | /* Buffer empty. Try to get more. */ |
174 | pcm_play_get_more_callback(&start, &size); | 174 | if (pcm_play_dma_complete_callback(PCM_DMAST_OK, &start, &size)) |
175 | |||
176 | if (size != 0) | ||
177 | { | 175 | { |
178 | unsigned long sdem_addr=(unsigned long)start - CONFIG_SDRAM_START; | 176 | unsigned long sdem_addr=(unsigned long)start - CONFIG_SDRAM_START; |
179 | /* Flush any pending cache writes */ | 177 | /* Flush any pending cache writes */ |
@@ -187,7 +185,7 @@ void DSPHINT(void) | |||
187 | DEBUGF("pcm_sdram at 0x%08lx, sdem_addr 0x%08lx", | 185 | DEBUGF("pcm_sdram at 0x%08lx, sdem_addr 0x%08lx", |
188 | (unsigned long)start, (unsigned long)sdem_addr); | 186 | (unsigned long)start, (unsigned long)sdem_addr); |
189 | 187 | ||
190 | pcm_play_dma_started_callback(); | 188 | pcm_play_dma_status_callback(PCM_DMAST_STARTED); |
191 | } | 189 | } |
192 | 190 | ||
193 | break; | 191 | break; |