Fixed to compile with T3.x (run only T4.x)

pull/16/merge
boblark 2 years ago
parent 2c66f6cdea
commit 88a600a916
  1. 14
      async_input_spdif3_F32.cpp
  2. 14
      async_input_spdif3_F32.h

@ -407,16 +407,18 @@ int32_t AsyncAudioInputSPDIF3_F32::getHalfFilterLength() const{
return _resampler.getHalfFilterLength();
}
#endif // __IMXRT1062__
// Only for T4.x (__IMXRT1062__).
#endif
#if defined(__MK66FX1M0__) || defined(__MK64FX512__) || defined(__MK20DX256__) || defined(__MKL26Z64__)
// empty code to allow compile (but no sound input) on other Teensy models
#include "async_input_spdif3.h"
AsyncAudioInputSPDIF3_F32::AsyncAudioInputSPDIF3_F32(bool dither, bool noiseshaping,float attenuation, int32_t minHalfFilterLength, int32_t maxHalfFilterLength):
AudioStream(0, NULL), _resampler(attenuation, minHalfFilterLength, maxHalfFilterLength)
{ }
#include "async_input_spdif3_F32.h"
// Removed next for T3.x compile. Bob L Jan 2023
//AsyncAudioInputSPDIF3_F32::AsyncAudioInputSPDIF3_F32(bool dither, bool noiseshaping,float attenuation, int32_t minHalfFilterLength, int32_t maxHalfFilterLength):
// AudioStream(0, NULL), _resampler(attenuation, minHalfFilterLength, maxHalfFilterLength)
// { }
void AsyncAudioInputSPDIF3_F32::begin() { }
void AsyncAudioInputSPDIF3_F32::update(void) { }
double AsyncAudioInputSPDIF3_F32::getBufferedTime() const { return 0; }
@ -427,6 +429,4 @@ double AsyncAudioInputSPDIF3_F32::getAttenuation() const { return 0; }
int32_t AsyncAudioInputSPDIF3_F32::getHalfFilterLength() const { return 0; }
AsyncAudioInputSPDIF3_F32::~AsyncAudioInputSPDIF3_F32() { }
#endif

@ -37,6 +37,9 @@
//#define DEBUG_SPDIF_IN //activates debug output
// Only for T4.x
// #if defined(__IMXRT1062__)
class Scaler_F32; // internal
class AsyncAudioInputSPDIF3_F32 : public AudioStream_F32
@ -55,7 +58,7 @@ public:
double getTargetLantency() const;
double getAttenuation() const;
int32_t getHalfFilterLength() const;
protected:
protected:
static DMAChannel dma;
static void isr(void);
private:
@ -74,12 +77,12 @@ private:
Resampler _resampler;
Scaler_F32* quantizer[2];
arm_biquad_cascade_df2T_instance_f32 _bufferLPFilter;
volatile double _bufferedTime;
volatile double _lastValidInputFrequ;
double _inputFrequency=0.;
double _targetLatencyS; //target latency [seconds]
const double _blockDuration=AUDIO_BLOCK_SAMPLES/AUDIO_SAMPLE_RATE_EXACT; //[seconds]
const double _blockDuration=AUDIO_BLOCK_SAMPLES/AUDIO_SAMPLE_RATE_EXACT; //[seconds]
double _maxLatency=2.*_blockDuration;
static float sample_rate_Hz; // configured output sample rate
@ -88,4 +91,7 @@ private:
#endif
};
#endif
// Only for T4.x
//#endif
#endif

Loading…
Cancel
Save