SPC music playback tools for real snes apu

Dependencies:   mbed

Committer:
akkera102
Date:
Sat Jan 14 13:27:06 2017 +0000
Revision:
6:0e2e1c4d3c8f
Parent:
5:37f42381cca9
fourth

Who changed what in which revision?

UserRevisionLine numberNew contents of line
akkera102 0:5bd52e196edb 1 #include "mbed.h"
akkera102 2:62e6e22f8be2 2 #include "cmd.h"
akkera102 0:5bd52e196edb 3
akkera102 0:5bd52e196edb 4 Serial pc(USBTX, USBRX);
akkera102 0:5bd52e196edb 5 LocalFileSystem local("local");
akkera102 0:5bd52e196edb 6
akkera102 2:62e6e22f8be2 7 int main(void)
akkera102 0:5bd52e196edb 8 {
akkera102 6:0e2e1c4d3c8f 9 DIR *d;
akkera102 6:0e2e1c4d3c8f 10 struct dirent *p;
akkera102 6:0e2e1c4d3c8f 11 char buf[64];
akkera102 6:0e2e1c4d3c8f 12
akkera102 0:5bd52e196edb 13 for(;;)
akkera102 0:5bd52e196edb 14 {
akkera102 6:0e2e1c4d3c8f 15 if((d = opendir("/local")) == NULL)
akkera102 6:0e2e1c4d3c8f 16 {
akkera102 6:0e2e1c4d3c8f 17 return -1;
akkera102 6:0e2e1c4d3c8f 18 }
akkera102 6:0e2e1c4d3c8f 19
akkera102 6:0e2e1c4d3c8f 20 while((p = readdir(d)) != NULL)
akkera102 6:0e2e1c4d3c8f 21 {
akkera102 6:0e2e1c4d3c8f 22 if(strstr(p->d_name, ".SPC") != NULL)
akkera102 6:0e2e1c4d3c8f 23 {
akkera102 6:0e2e1c4d3c8f 24 sprintf(buf, "/local/%s", p->d_name);
akkera102 6:0e2e1c4d3c8f 25 cmd(buf);
akkera102 6:0e2e1c4d3c8f 26 }
akkera102 6:0e2e1c4d3c8f 27 }
akkera102 6:0e2e1c4d3c8f 28
akkera102 6:0e2e1c4d3c8f 29 printf("All done.\n");
akkera102 6:0e2e1c4d3c8f 30 wait(1);
akkera102 6:0e2e1c4d3c8f 31
akkera102 6:0e2e1c4d3c8f 32 closedir(d);
akkera102 0:5bd52e196edb 33 }
akkera102 0:5bd52e196edb 34 }