many many small changes

switched to the new logging here and there
some cleanups
worked  on i2S
base class for files
id3 parsing
This commit is contained in:
2021-02-28 20:44:01 +01:00
parent df77490622
commit 422610c21c
18 changed files with 307 additions and 197 deletions

View File

@@ -165,6 +165,8 @@ private:
// init static class members
#ifdef I2S2_IMPLEMENTATION
DMAMEM __attribute__((aligned(32))) int16_t I2S2::buffer[I2S2_BUFFER_SAMPLES];
I2S2::State I2S2::state;
//template<> DMAMEM __attribute__((aligned(32))) int16_t I2SBase<I2S2>::buffer[I2S2_BUFFER_SAMPLES];
//template<> I2SBase<I2S2>::State I2SBase<I2S2>::state;
DMAMEM __attribute__((aligned(32))) int16_t I2S2::buffer[I2S2_BUFFER_SAMPLES];
I2S2::State I2S2::state;
#endif

View File

@@ -80,7 +80,9 @@ public:
static void clearBuffer() {
memset(buffer, 0, sizeof(buffer));
state.bufferHalf[0].samplesUsed = 0;
state.bufferHalf[0].dropCache();
state.bufferHalf[1].samplesUsed = 0;
state.bufferHalf[1].dropCache();
}
/** block until the given number of samples were added to the internal buffer */
@@ -99,7 +101,7 @@ public:
BufferHalf& bh = state.fillingHalf();
// determine how many samples to add
const uint16_t addable = min(numSamples, bh.samplesFree());
const uint16_t addable = std::min(numSamples, bh.samplesFree());
// actually copy the data
uint8_t* dst = (uint8_t*) (&bh.mem[bh.samplesUsed]);