ELEC2645 (2018/19) / Mbed 2 deprecated el17st

Dependencies:   mbed FATFileSystem

Revision:
21:f3b0ce18b44f
Parent:
18:14e5391beccf
Child:
26:716bcd47f3ca
--- a/WDplayer/WDplayer.cpp	Wed May 08 15:48:44 2019 +0000
+++ b/WDplayer/WDplayer.cpp	Thu May 09 06:22:53 2019 +0000
@@ -58,7 +58,7 @@
     _fptr = fopen(_path,"r");
     fseek(_fptr,44,SEEK_SET);
     }
-    //Sampling If Statements
+    //end of file reset
     if (_tck == _length) {
         _fptr = NULL;
         _tck = 0;
@@ -82,7 +82,7 @@
         vtck = 4000;
         _tck = 0;
     }
-    //CORE ENGINE WRITING
+    //CORE ENGINE - Opertes on a two data Block system one to read from and one to write to.
     if (_tck + 2000 >= _length) {
         _fptr = NULL;
         _tck = 0;
@@ -128,13 +128,14 @@
 }
 
 void WDplayer::ISRreset() {
+    ISR.detach();
     free(cache);
     lock = false;
     vtck = 4000;
     _tck = 0;
-    ISR.detach();
 }
 
+//ISR attached Function
 void WDplayer::ISRtck() {
     _dac->write( cache[vtck] / 255.00 );
     if (vtck == 4000) {