diff options
Diffstat (limited to 'firmware/target/arm/pnx0101')
-rw-r--r-- | firmware/target/arm/pnx0101/pcm-pnx0101.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/firmware/target/arm/pnx0101/pcm-pnx0101.c b/firmware/target/arm/pnx0101/pcm-pnx0101.c index 89d56af374..bb11ad32fe 100644 --- a/firmware/target/arm/pnx0101/pcm-pnx0101.c +++ b/firmware/target/arm/pnx0101/pcm-pnx0101.c | |||
@@ -28,7 +28,7 @@ | |||
28 | short __attribute__((section(".dmabuf"))) dma_buf_left[DMA_BUF_SAMPLES]; | 28 | short __attribute__((section(".dmabuf"))) dma_buf_left[DMA_BUF_SAMPLES]; |
29 | short __attribute__((section(".dmabuf"))) dma_buf_right[DMA_BUF_SAMPLES]; | 29 | short __attribute__((section(".dmabuf"))) dma_buf_right[DMA_BUF_SAMPLES]; |
30 | 30 | ||
31 | unsigned short* p IBSS_ATTR; | 31 | const int16_t* p IBSS_ATTR; |
32 | size_t p_size IBSS_ATTR; | 32 | size_t p_size IBSS_ATTR; |
33 | 33 | ||
34 | void pcm_play_lock(void) | 34 | void pcm_play_lock(void) |
@@ -41,7 +41,7 @@ void pcm_play_unlock(void) | |||
41 | 41 | ||
42 | void pcm_play_dma_start(const void *addr, size_t size) | 42 | void pcm_play_dma_start(const void *addr, size_t size) |
43 | { | 43 | { |
44 | p = (unsigned short*)addr; | 44 | p = addr; |
45 | p_size = size; | 45 | p_size = size; |
46 | } | 46 | } |
47 | 47 | ||
@@ -69,7 +69,7 @@ static inline void fill_dma_buf(int offset) | |||
69 | do | 69 | do |
70 | { | 70 | { |
71 | int count; | 71 | int count; |
72 | unsigned short *tmp_p; | 72 | const int16_t *tmp_p; |
73 | count = MIN(p_size / 4, (size_t)(lend - l)); | 73 | count = MIN(p_size / 4, (size_t)(lend - l)); |
74 | tmp_p = p; | 74 | tmp_p = p; |
75 | p_size -= count * 4; | 75 | p_size -= count * 4; |
@@ -109,16 +109,14 @@ static inline void fill_dma_buf(int offset) | |||
109 | if (new_buffer) | 109 | if (new_buffer) |
110 | { | 110 | { |
111 | new_buffer = false; | 111 | new_buffer = false; |
112 | pcm_play_dma_started_callback(); | 112 | pcm_play_dma_status_callback(PCM_DMAST_STARTED); |
113 | } | 113 | } |
114 | 114 | ||
115 | if (l >= lend) | 115 | if (l >= lend) |
116 | return; | 116 | return; |
117 | 117 | ||
118 | pcm_play_get_more_callback((void**)&p, &p_size); | 118 | new_buffer = pcm_play_dma_complete_callback(PCM_DMAST_OK, |
119 | 119 | &p, &p_size); | |
120 | if (p_size) | ||
121 | new_buffer = true; | ||
122 | } | 120 | } |
123 | while (p_size); | 121 | while (p_size); |
124 | } | 122 | } |