summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8700
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s5l8700')
-rw-r--r--firmware/target/arm/s5l8700/pcm-s5l8700.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8700/pcm-s5l8700.c b/firmware/target/arm/s5l8700/pcm-s5l8700.c
index 08086c37d8..14c515ec47 100644
--- a/firmware/target/arm/s5l8700/pcm-s5l8700.c
+++ b/firmware/target/arm/s5l8700/pcm-s5l8700.c
@@ -27,6 +27,7 @@
27#include "panic.h" 27#include "panic.h"
28#include "audiohw.h" 28#include "audiohw.h"
29#include "pcm.h" 29#include "pcm.h"
30#include "pcm-internal.h"
30#include "pcm_sampr.h" 31#include "pcm_sampr.h"
31#include "dma-target.h" 32#include "dma-target.h"
32#include "mmu-arm.h" 33#include "mmu-arm.h"
@@ -100,6 +101,7 @@ void pcm_play_unlock(void)
100void INT_DMA(void) ICODE_ATTR; 101void INT_DMA(void) ICODE_ATTR;
101void INT_DMA(void) 102void INT_DMA(void)
102{ 103{
104 bool new_buffer = false;
103 DMACOM0 = 7; 105 DMACOM0 = 7;
104 while (!(DMACON0 & (1 << 18))) 106 while (!(DMACON0 & (1 << 18)))
105 { 107 {
@@ -112,8 +114,12 @@ void INT_DMA(void)
112 } 114 }
113 else 115 else
114 { 116 {
115 if (!nextsize) pcm_play_get_more_callback((void**)&nextbuf, &nextsize); 117 if (!nextsize)
116 if (!nextsize) break; 118 {
119 pcm_play_get_more_callback((void**)&nextbuf, &nextsize);
120 if (!nextsize) break;
121 new_buffer = true;
122 }
117 queuedsize = MIN(sizeof(dblbuf), nextsize / 2); 123 queuedsize = MIN(sizeof(dblbuf), nextsize / 2);
118 nextsize -= queuedsize; 124 nextsize -= queuedsize;
119 queuedbuf = nextbuf + nextsize; 125 queuedbuf = nextbuf + nextsize;
@@ -124,7 +130,14 @@ void INT_DMA(void)
124 clean_dcache(); 130 clean_dcache();
125 DMACOM0 = 4; 131 DMACOM0 = 4;
126 DMACOM0 = 7; 132 DMACOM0 = 7;
133
134 if (new_buffer)
135 {
136 pcm_play_dma_started_callback();
137 new_buffer = false;
138 }
127 } 139 }
140
128} 141}
129 142
130void pcm_play_dma_start(const void* addr, size_t size) 143void pcm_play_dma_start(const void* addr, size_t size)