diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-02-12 02:04:26 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-02-12 02:04:26 +0000 |
commit | e6bac4c6f4b56fcc045b777ee1f086029c40ffa3 (patch) | |
tree | c65067661f95eeecd7c626b95a6ac3a279718a0a /firmware/target/arm/imx31/gigabeat-s/pcm-imx31.c | |
parent | 911cc69ebd037f8fa17b77590b2e3e99ea6b0644 (diff) | |
download | rockbox-e6bac4c6f4b56fcc045b777ee1f086029c40ffa3.tar.gz rockbox-e6bac4c6f4b56fcc045b777ee1f086029c40ffa3.zip |
Gigabeat S: Handle any DMA playback errors reported and stop in that case (none are expected but it's better to handle than ignore).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19983 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/pcm-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/pcm-imx31.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/pcm-imx31.c b/firmware/target/arm/imx31/gigabeat-s/pcm-imx31.c index 7aa7a2ae19..39c0bc4969 100644 --- a/firmware/target/arm/imx31/gigabeat-s/pcm-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/pcm-imx31.c | |||
@@ -51,7 +51,7 @@ static struct dma_data dma_play_data = | |||
51 | static void play_dma_callback(void) | 51 | static void play_dma_callback(void) |
52 | { | 52 | { |
53 | unsigned char *start; | 53 | unsigned char *start; |
54 | size_t size; | 54 | size_t size = 0; |
55 | pcm_more_callback_type get_more = pcm_callback_for_more; | 55 | pcm_more_callback_type get_more = pcm_callback_for_more; |
56 | 56 | ||
57 | if (dma_play_data.locked != 0) | 57 | if (dma_play_data.locked != 0) |
@@ -61,13 +61,11 @@ static void play_dma_callback(void) | |||
61 | return; | 61 | return; |
62 | } | 62 | } |
63 | 63 | ||
64 | if (get_more == NULL || (get_more(&start, &size), size == 0)) | 64 | if (dma_play_bd.mode.status & BD_RROR) |
65 | { | 65 | { |
66 | /* Callback missing or no more DMA to do */ | 66 | /* Stop on error */ |
67 | pcm_play_dma_stop(); | ||
68 | pcm_play_dma_stopped_callback(); | ||
69 | } | 67 | } |
70 | else | 68 | else if (get_more != NULL && (get_more(&start, &size), size != 0)) |
71 | { | 69 | { |
72 | start = (void*)(((unsigned long)start + 3) & ~3); | 70 | start = (void*)(((unsigned long)start + 3) & ~3); |
73 | size &= ~3; | 71 | size &= ~3; |
@@ -79,7 +77,12 @@ static void play_dma_callback(void) | |||
79 | dma_play_bd.mode.command = TRANSFER_16BIT; | 77 | dma_play_bd.mode.command = TRANSFER_16BIT; |
80 | dma_play_bd.mode.status = BD_DONE | BD_WRAP | BD_INTR; | 78 | dma_play_bd.mode.status = BD_DONE | BD_WRAP | BD_INTR; |
81 | sdma_channel_run(DMA_PLAY_CH_NUM); | 79 | sdma_channel_run(DMA_PLAY_CH_NUM); |
80 | return; | ||
82 | } | 81 | } |
82 | |||
83 | /* Error, callback missing or no more DMA to do */ | ||
84 | pcm_play_dma_stop(); | ||
85 | pcm_play_dma_stopped_callback(); | ||
83 | } | 86 | } |
84 | 87 | ||
85 | void pcm_play_lock(void) | 88 | void pcm_play_lock(void) |