From 0de4b41588e214f8eec9a82a76ea44ea5aed08e0 Mon Sep 17 00:00:00 2001 From: "Mr.Blinky" Date: Fri, 21 Sep 2018 00:32:21 +0200 Subject: [PATCH] Fixed interrupt glitch in ATMlib.play() p2 Disabled timer/counter 4 overflow interrupt at beginning of play() to prevent bad sounds from being played when song is changed while playing --- board-package-source/libraries/ATMlib/src/ATMlib.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/board-package-source/libraries/ATMlib/src/ATMlib.cpp b/board-package-source/libraries/ATMlib/src/ATMlib.cpp index 8b83c11..9c744af 100644 --- a/board-package-source/libraries/ATMlib/src/ATMlib.cpp +++ b/board-package-source/libraries/ATMlib/src/ATMlib.cpp @@ -109,6 +109,7 @@ static inline const byte *getTrackPointer(byte track) { void ATMsynth::play(const byte *song) { + TIMSK4 = 0b00000000;// ensure interrupt is disabled cia_count = 1; // cleanUp stuff first memset(channel, 0, sizeof(channel));