瀏覽代碼

cache-support mqs

dds
Frank Bösing 5 年之前
父節點
當前提交
1a5bd3ed27
共有 1 個文件被更改,包括 12 次插入7 次删除
  1. +12
    -7
      output_mqs.cpp

+ 12
- 7
output_mqs.cpp 查看文件

@@ -38,8 +38,10 @@ audio_block_t * AudioOutputMQS::block_right_2nd = NULL;
uint16_t AudioOutputMQS::block_left_offset = 0;
uint16_t AudioOutputMQS::block_right_offset = 0;
bool AudioOutputMQS::update_responsibility = false;
static uint32_t I2S3_tx_buffer[AUDIO_BLOCK_SAMPLES];
DMAChannel AudioOutputMQS::dma(false);
DMAMEM __attribute__((aligned(32)))
static uint32_t I2S3_tx_buffer[AUDIO_BLOCK_SAMPLES];


void AudioOutputMQS::begin(void)
{
@@ -99,18 +101,21 @@ void AudioOutputMQS::isr(void)
if (blockL && blockR) {
memcpy_tointerleaveLR(dest, blockL->data + offsetL, blockR->data + offsetR);
offsetL += AUDIO_BLOCK_SAMPLES / 2;
offsetR += AUDIO_BLOCK_SAMPLES / 2;
offsetR += AUDIO_BLOCK_SAMPLES / 2;
} else if (blockL) {
memcpy_tointerleaveL(dest, blockL->data + offsetL);
offsetL += AUDIO_BLOCK_SAMPLES / 2;
offsetL += AUDIO_BLOCK_SAMPLES / 2;
} else if (blockR) {
memcpy_tointerleaveR(dest, blockR->data + offsetR);
offsetR += AUDIO_BLOCK_SAMPLES / 2;
offsetR += AUDIO_BLOCK_SAMPLES / 2;
} else {
memset(dest,0,AUDIO_BLOCK_SAMPLES * 2);
return;
memset(dest,0, sizeof(I2S3_tx_buffer) / 2);
}

#if IMXRT_CACHE_ENABLED >= 2
arm_dcache_flush_delete(dest, sizeof(I2S3_tx_buffer) / 2 );
#endif
if (offsetL < AUDIO_BLOCK_SAMPLES) {
AudioOutputMQS::block_left_offset = offsetL;
} else {

Loading…
取消
儲存