SPC music playback tools for real snes apu

Dependencies:   mbed

main.cpp

Committer:
akkera102
Date:
10 months ago
Revision:
8:072621697467
Parent:
5:37f42381cca9

File content as of revision 8:072621697467:

#include "mbed.h"
#include "cmd.h"

Serial pc(USBTX, USBRX);
LocalFileSystem local("local");

int main(void)
{
    DIR *d;
    struct dirent *p;
    char buf[64];

    for(;;)
    {
        if((d = opendir("/local")) == NULL)
        {
            return -1;
        }

        while((p = readdir(d)) != NULL)
        {
            if(strstr(p->d_name, ".SPC") != NULL)
            {
                sprintf(buf, "/local/%s", p->d_name);
                cmd(buf);
            }
        }

        printf("All done.\n");
        wait(1);

        closedir(d);
    }
}