Procházet zdrojové kódy

cache-support i2s/i2s2

dds
Frank Bösing před 6 roky
rodič
revize
b262957335
2 změnil soubory, kde provedl 11 přidání a 6 odebrání
  1. +5
    -2
      output_i2s.cpp
  2. +6
    -4
      output_i2s2.cpp

+ 5
- 2
output_i2s.cpp Zobrazit soubor

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 {

+ 6
- 4
output_i2s2.cpp Zobrazit soubor

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 {

Načítá se…
Zrušit
Uložit