ソースを参照

cache-support i2s/i2s2

dds
Frank Bösing 5年前
コミット
b262957335
2個のファイルの変更11行の追加6行の削除
  1. +5
    -2
      output_i2s.cpp
  2. +6
    -4
      output_i2s2.cpp

+ 5
- 2
output_i2s.cpp ファイルの表示

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

#if defined(__IMXRT1052__) || defined(__IMXRT1062__)
#include "utility/imxrt_hw.h"
@@ -147,9 +147,12 @@ void AudioOutputI2S::isr(void)
offsetR += AUDIO_BLOCK_SAMPLES / 2;
} else {
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) {
AudioOutputI2S::block_left_offset = offsetL;
} else {

+ 6
- 4
output_i2s2.cpp ファイルの表示

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

#include "utility/imxrt_hw.h"

@@ -105,10 +104,13 @@ void AudioOutputI2S2::isr(void)
memcpy_tointerleaveR(dest, blockR->data + offsetR);
offsetR += AUDIO_BLOCK_SAMPLES / 2;
} 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) {
AudioOutputI2S2::block_left_offset = offsetL;
} else {

読み込み中…
キャンセル
保存