uint16_t AudioOutputI2S::block_left_offset = 0; | uint16_t AudioOutputI2S::block_left_offset = 0; | ||||
uint16_t AudioOutputI2S::block_right_offset = 0; | uint16_t AudioOutputI2S::block_right_offset = 0; | ||||
bool AudioOutputI2S::update_responsibility = false; | bool AudioOutputI2S::update_responsibility = false; | ||||
static uint32_t i2s_tx_buffer[AUDIO_BLOCK_SAMPLES]; | |||||
DMAChannel AudioOutputI2S::dma(false); | DMAChannel AudioOutputI2S::dma(false); | ||||
DMAMEM __attribute__((aligned(32))) static uint32_t i2s_tx_buffer[AUDIO_BLOCK_SAMPLES]; | |||||
#if defined(__IMXRT1052__) || defined(__IMXRT1062__) | #if defined(__IMXRT1052__) || defined(__IMXRT1062__) | ||||
#include "utility/imxrt_hw.h" | #include "utility/imxrt_hw.h" | ||||
offsetR += AUDIO_BLOCK_SAMPLES / 2; | offsetR += AUDIO_BLOCK_SAMPLES / 2; | ||||
} else { | } else { | ||||
memset(dest,0,AUDIO_BLOCK_SAMPLES * 2); | memset(dest,0,AUDIO_BLOCK_SAMPLES * 2); | ||||
return; | |||||
} | } | ||||
#if IMXRT_CACHE_ENABLED >= 2 | |||||
arm_dcache_flush_delete(dest, sizeof(i2s_tx_buffer) / 2 ); | |||||
#endif | |||||
if (offsetL < AUDIO_BLOCK_SAMPLES) { | if (offsetL < AUDIO_BLOCK_SAMPLES) { | ||||
AudioOutputI2S::block_left_offset = offsetL; | AudioOutputI2S::block_left_offset = offsetL; | ||||
} else { | } else { |
uint16_t AudioOutputI2S2::block_left_offset = 0; | uint16_t AudioOutputI2S2::block_left_offset = 0; | ||||
uint16_t AudioOutputI2S2::block_right_offset = 0; | uint16_t AudioOutputI2S2::block_right_offset = 0; | ||||
bool AudioOutputI2S2::update_responsibility = false; | bool AudioOutputI2S2::update_responsibility = false; | ||||
static uint32_t i2s2_tx_buffer[AUDIO_BLOCK_SAMPLES]; | |||||
DMAChannel AudioOutputI2S2::dma(false); | DMAChannel AudioOutputI2S2::dma(false); | ||||
DMAMEM __attribute__((aligned(32))) static uint32_t i2s2_tx_buffer[AUDIO_BLOCK_SAMPLES]; | |||||
#include "utility/imxrt_hw.h" | #include "utility/imxrt_hw.h" | ||||
memcpy_tointerleaveR(dest, blockR->data + offsetR); | memcpy_tointerleaveR(dest, blockR->data + offsetR); | ||||
offsetR += AUDIO_BLOCK_SAMPLES / 2; | offsetR += AUDIO_BLOCK_SAMPLES / 2; | ||||
} else { | } else { | ||||
memset(dest,0,AUDIO_BLOCK_SAMPLES * 2); | |||||
return; | |||||
memset(dest,0,AUDIO_BLOCK_SAMPLES * 2); | |||||
} | } | ||||
#if IMXRT_CACHE_ENABLED >= 2 | |||||
arm_dcache_flush_delete(dest, sizeof(i2s2_tx_buffer) / 2 ); | |||||
#endif | |||||
if (offsetL < AUDIO_BLOCK_SAMPLES) { | if (offsetL < AUDIO_BLOCK_SAMPLES) { | ||||
AudioOutputI2S2::block_left_offset = offsetL; | AudioOutputI2S2::block_left_offset = offsetL; | ||||
} else { | } else { |