SPC music playback tools for real snes apu

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "cmd.h"
00003 
00004 Serial pc(USBTX, USBRX);
00005 LocalFileSystem local("local");
00006 
00007 int main(void)
00008 {
00009     DIR *d;
00010     struct dirent *p;
00011     char buf[64];
00012 
00013     for(;;)
00014     {
00015         if((d = opendir("/local")) == NULL)
00016         {
00017             return -1;
00018         }
00019 
00020         while((p = readdir(d)) != NULL)
00021         {
00022             if(strstr(p->d_name, ".SPC") != NULL)
00023             {
00024                 sprintf(buf, "/local/%s", p->d_name);
00025                 cmd(buf);
00026             }
00027         }
00028 
00029         printf("All done.\n");
00030         wait(1);
00031 
00032         closedir(d);
00033     }
00034 }