I have no idea why, but even with the both interrupts turned on for the USART 0 Bi-directional and SPORT 0 RX I can only fire one but not the other...Is it possible to get both to execute ? I'm not running USART 0 on DMA, only with the built in interrupt. Seems the DMA Interrupts for the SPORT 0 RX take precedence over the UART. As you can see in the code below when I shut off the SPORT DMA's inside the handler, then the UART 0 Bi-directional interrupts kick in again...This is quite strange since the UART interrupts should run unaffected by the SPORT perhipheral ? Can this work simultaneously, both UART and SPORT(s) interrupts ?
// Function disable_SPORT disables SPORT first and then DMA
void disable_SPORT(void)
{
*pREG_SPORT0_CTL_B &= ~1;
*pREG_SPORT0_CTL_A &= ~1;
__builtin_ssync();
*pREG_DMA0_CFG &= ~ENUM_DMA_CFG_EN;
*pREG_DMA1_CFG &= ~ENUM_DMA_CFG_EN;
__builtin_ssync();
}
// Function SPORT0_RX_interrupt_handler is called after a complete
// frame of input data has been received.
void SPORT0_RX_interrupt_handler(uint32_t iid, void *handlerArg)
{
audio_buffer[0] = SP0B_buffer[0] << 8;
audio_buffer[1] = SP0B_buffer[1] << 8;
//audio_processing(audio_buffer, 2);
SP0A_buffer[0] = audio_buffer[0] >> 8;
SP0A_buffer[1] = audio_buffer[1] >> 8;
//*pREG_UART0_IMSK_SET=0x0001;
disable_SPORT();
}