diff options
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/pcm-as3525.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c index 01d228f784..5a403bad83 100644 --- a/firmware/target/arm/as3525/pcm-as3525.c +++ b/firmware/target/arm/as3525/pcm-as3525.c | |||
@@ -40,18 +40,20 @@ static size_t dma_size; /* in 4*32 bits */ | |||
40 | static void dma_callback(void); | 40 | static void dma_callback(void); |
41 | static int locked = 0; | 41 | static int locked = 0; |
42 | 42 | ||
43 | static int play_irq_state; | ||
44 | |||
43 | /* Mask the DMA interrupt */ | 45 | /* Mask the DMA interrupt */ |
44 | void pcm_play_lock(void) | 46 | void pcm_play_lock(void) |
45 | { | 47 | { |
46 | if(++locked == 1) | 48 | if(++locked == 1) |
47 | VIC_INT_EN_CLEAR = INTERRUPT_DMAC; | 49 | play_irq_state = disable_irq_save(); |
48 | } | 50 | } |
49 | 51 | ||
50 | /* Unmask the DMA interrupt if enabled */ | 52 | /* Unmask the DMA interrupt if enabled */ |
51 | void pcm_play_unlock(void) | 53 | void pcm_play_unlock(void) |
52 | { | 54 | { |
53 | if(--locked == 0) | 55 | if(--locked == 0) |
54 | VIC_INT_ENABLE = INTERRUPT_DMAC; | 56 | restore_irq(play_irq_state); |
55 | } | 57 | } |
56 | 58 | ||
57 | static void play_start_pcm(void) | 59 | static void play_start_pcm(void) |
@@ -198,18 +200,19 @@ static void rec_dma_callback(void); | |||
198 | static int16_t *mono_samples; | 200 | static int16_t *mono_samples; |
199 | #endif | 201 | #endif |
200 | 202 | ||
203 | static int rec_irq_state; | ||
201 | 204 | ||
202 | void pcm_rec_lock(void) | 205 | void pcm_rec_lock(void) |
203 | { | 206 | { |
204 | if(++rec_locked == 1) | 207 | if(++rec_locked == 1) |
205 | VIC_INT_EN_CLEAR = INTERRUPT_DMAC; | 208 | rec_irq_state = disable_irq_save(); |
206 | } | 209 | } |
207 | 210 | ||
208 | 211 | ||
209 | void pcm_rec_unlock(void) | 212 | void pcm_rec_unlock(void) |
210 | { | 213 | { |
211 | if(--rec_locked == 0) | 214 | if(--rec_locked == 0) |
212 | VIC_INT_ENABLE = INTERRUPT_DMAC; | 215 | restore_irq(rec_irq_state); |
213 | } | 216 | } |
214 | 217 | ||
215 | 218 | ||