digitalwire
Member
I play a WAV file from Teensy SD card to decode morse signals via the audio lib. For this I use AudioAnalyzeToneDetect. I call the function every 5ms. After a few seconds teensy hangs up and emits a humming sound, a few seconds later teensy is restarted by the internal watchdog.
How can I find out the reason for the crash?
At what time interval can AudioAnalyzeToneDetect be called?
Complete source is attached
How can I find out the reason for the crash?
At what time interval can AudioAnalyzeToneDetect be called?
C-like:
// Audio - begin automatically generated code
AudioInputI2S Line_In; //xy=67.16668701171875,58.00000762939453
AudioPlaySdWav PlayWAV; //xy=79.16667175292969,115.16666412353516
AudioSynthWaveformSine Key_Mithoerton; //xy=88.16668701171875,175
AudioMixer4 TRX_Mixer; //xy=297.16668701171875,67.00000762939453
AudioMixer4 SPK_Mixer; //xy=300.16668701171875,164
AudioAnalyzeToneDetect CW_Tone_Detector; //xy=568.1666870117188,66.00000762939453
AudioOutputI2S Line_Out; //xy=602.1666870117188,168
AudioConnection patchCord1(Line_In, 1, TRX_Mixer, 0);
AudioConnection patchCord2(Line_In, 1, SPK_Mixer, 0);
AudioConnection patchCord5(Key_Mithoerton, 0, SPK_Mixer, 1);
AudioConnection patchCord6(Key_Mithoerton, 0, TRX_Mixer, 1);
AudioConnection patchCord3(PlayWAV, 0, TRX_Mixer, 2);
AudioConnection patchCord4(PlayWAV, 0, SPK_Mixer, 2);
AudioConnection patchCord7(TRX_Mixer, CW_Tone_Detector);
AudioConnection patchCord8(SPK_Mixer, 0, Line_Out, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=297.16668701171875,245
C-like:
void auInit() {
AudioMemory(8);
sgtl5000_1.enable();
sgtl5000_1.volume(1.0);
sgtl5000_1.lineInLevel(15);
sgtl5000_1.lineOutLevel(21);
sgtl5000_1.micGain(0);
SPI.setMOSI(SDCARD_MOSI_PIN);
SPI.setSCK(SDCARD_SCK_PIN);
if (!(SD.begin(SDCARD_CS_PIN))) {
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
auSelectAudioSource(AUDIO_SRC_NONE);
}
Complete source is attached