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 =
721 ; TaskScheduler
322 ; SdFat
401 ; Adafruit SleepyDog Library
[env:teensy35]
platform = teensy

View file

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