mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
as3525: as revealed by r26311, it seems DMAC interrupt can't be masked
Even if we disable it in VIC_INT_EN_CLEAR, it still fires an interrupt by running the default isr. Locking requires disabling interrupts completely. I'm not sure if DMAC is the only interrupt affected or if we can't rely on VIC_INT_EN_CLEAR to mask interrupts. If it's the latter, we will need to have special locking scheme for INT_AUDIO. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26316 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bc2f8bbc07
commit
c9133db4b1
1 changed files with 7 additions and 4 deletions
|
|
@ -40,18 +40,20 @@ static size_t dma_size; /* in 4*32 bits */
|
|||
static void dma_callback(void);
|
||||
static int locked = 0;
|
||||
|
||||
static int play_irq_state;
|
||||
|
||||
/* Mask the DMA interrupt */
|
||||
void pcm_play_lock(void)
|
||||
{
|
||||
if(++locked == 1)
|
||||
VIC_INT_EN_CLEAR = INTERRUPT_DMAC;
|
||||
play_irq_state = disable_irq_save();
|
||||
}
|
||||
|
||||
/* Unmask the DMA interrupt if enabled */
|
||||
void pcm_play_unlock(void)
|
||||
{
|
||||
if(--locked == 0)
|
||||
VIC_INT_ENABLE = INTERRUPT_DMAC;
|
||||
restore_irq(play_irq_state);
|
||||
}
|
||||
|
||||
static void play_start_pcm(void)
|
||||
|
|
@ -198,18 +200,19 @@ static void rec_dma_callback(void);
|
|||
static int16_t *mono_samples;
|
||||
#endif
|
||||
|
||||
static int rec_irq_state;
|
||||
|
||||
void pcm_rec_lock(void)
|
||||
{
|
||||
if(++rec_locked == 1)
|
||||
VIC_INT_EN_CLEAR = INTERRUPT_DMAC;
|
||||
rec_irq_state = disable_irq_save();
|
||||
}
|
||||
|
||||
|
||||
void pcm_rec_unlock(void)
|
||||
{
|
||||
if(--rec_locked == 0)
|
||||
VIC_INT_ENABLE = INTERRUPT_DMAC;
|
||||
restore_irq(rec_irq_state);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue