DMA channels which are 'allocated' can't be shared. Instead of using
the value '1' in the related 'mutex', use 0xff which won't match any task.
Signed-off-by: Keith Packard <keithp@keithp.com>
if (ao_dma_allocated[index]) {
if (ao_dma_mutex[index])
ao_panic(AO_PANIC_DMA);
if (ao_dma_allocated[index]) {
if (ao_dma_mutex[index])
ao_panic(AO_PANIC_DMA);
- ao_dma_mutex[index] = 1;
+ ao_dma_mutex[index] = 0xff;
} else
ao_mutex_get(&ao_dma_mutex[index]);
ao_arch_critical(
} else
ao_mutex_get(&ao_dma_mutex[index]);
ao_arch_critical(