diff options
Diffstat (limited to 'firmware/pcm_playback.c')
-rw-r--r-- | firmware/pcm_playback.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c index 04630f100f..cad835e20e 100644 --- a/firmware/pcm_playback.c +++ b/firmware/pcm_playback.c | |||
@@ -137,6 +137,7 @@ static void dma_stop(void) | |||
137 | { | 137 | { |
138 | pcm_playing = false; | 138 | pcm_playing = false; |
139 | 139 | ||
140 | DCR0 = 0; | ||
140 | /* Reset the FIFO */ | 141 | /* Reset the FIFO */ |
141 | IIS2CONFIG = 0x800; | 142 | IIS2CONFIG = 0x800; |
142 | } | 143 | } |
@@ -260,12 +261,19 @@ void pcm_play_pause(bool play) | |||
260 | { | 261 | { |
261 | if(pcm_paused && play && pcmbuf_unplayed_bytes) | 262 | if(pcm_paused && play && pcmbuf_unplayed_bytes) |
262 | { | 263 | { |
264 | logf("unpause"); | ||
265 | /* Reset chunk size so dma has enough data to fill the fifo. */ | ||
266 | SAR0 = (unsigned long)next_start; | ||
267 | BCR0 = next_size; | ||
263 | /* Enable the FIFO and force one write to it */ | 268 | /* Enable the FIFO and force one write to it */ |
264 | IIS2CONFIG = (pcm_freq << 12) | 0x300; | 269 | IIS2CONFIG = (pcm_freq << 12) | 0x300; |
265 | DCR0 |= DMA_START; | 270 | DCR0 |= DMA_EEXT | DMA_START; |
266 | } | 271 | } |
267 | else if(!pcm_paused && !play) | 272 | else if(!pcm_paused && !play) |
268 | { | 273 | { |
274 | logf("pause"); | ||
275 | /* Disable DMA peripheral request. */ | ||
276 | DCR0 &= ~DMA_EEXT; | ||
269 | IIS2CONFIG = 0x800; | 277 | IIS2CONFIG = 0x800; |
270 | } | 278 | } |
271 | pcm_paused = !play; | 279 | pcm_paused = !play; |
@@ -283,7 +291,7 @@ void DMA0(void) | |||
283 | int res = DSR0; | 291 | int res = DSR0; |
284 | 292 | ||
285 | DSR0 = 1; /* Clear interrupt */ | 293 | DSR0 = 1; /* Clear interrupt */ |
286 | 294 | ||
287 | /* Stop on error */ | 295 | /* Stop on error */ |
288 | if(res & 0x70) | 296 | if(res & 0x70) |
289 | { | 297 | { |