watchdog added... still not satisfied about stability... T.T

This commit is contained in:
Dooho Yi 2019-12-31 00:25:19 +09:00
parent c78b4d5601
commit 51ad7dec35
3 changed files with 36 additions and 26 deletions

View file

@ -16,6 +16,7 @@ lib_ignore = Audio, SD
lib_deps = lib_deps =
721 ; TaskScheduler 721 ; TaskScheduler
322 ; SdFat 322 ; SdFat
401 ; Adafruit SleepyDog Library
[env:teensy35] [env:teensy35]
platform = teensy platform = teensy

View file

@ -33,6 +33,9 @@
// #define ANALOG_REF_EXTERNAL_3P3V // #define ANALOG_REF_EXTERNAL_3P3V
//----------</configuration>---------- //----------</configuration>----------
//watchdog
#include <Adafruit_SleepyDog.h>
//teensy audio //teensy audio
#include <Audio.h> #include <Audio.h>
#include <SdFat.h> #include <SdFat.h>
@ -121,7 +124,7 @@ public:
// the filename to play is... // the filename to play is...
Serial.println(filename); Serial.println(filename);
// go! (re-triggering) // go! (re-triggering)
if (player.isPlaying()) player.stop(); // if (player.isPlaying()) player.stop();
player.play(filename); player.play(filename);
Serial.println("1"); Serial.println("1");
// --> we just believe that this 'file' is existing & available. NO additional checking. // --> we just believe that this 'file' is existing & available. NO additional checking.
@ -303,6 +306,9 @@ void playcheck() {
// // // //
// Serial.print("AM_max:"); // Serial.print("AM_max:");
// Serial.println(AudioMemoryUsageMax()); // Serial.println(AudioMemoryUsageMax());
//watchdog
Watchdog.reset();
} }
// //
Task playcheck_task(100, TASK_FOREVER, playcheck, &runner, true); Task playcheck_task(100, TASK_FOREVER, playcheck, &runner, true);
@ -462,6 +468,9 @@ void setup() {
// //
Serial.println("[setup] done."); Serial.println("[setup] done.");
//watchdog
Watchdog.enable(1000);
} }
void loop() { void loop() {