#include #include #include "config.h" #include "buttons.h" #include "controller.h" #include "player.h" #include "sd_card.h" #include "spi_master.h" Buttons* buttons; Controller* controller; Player* player; SDCard* sd; void printDirectory(File dir, int numTabs) { while (true) { File entry = dir.openNextFile(); if (! entry) { // no more files break; } for (uint8_t i = 0; i < numTabs; i++) { Serial.print('\t'); } Serial.print(entry.name()); if (entry.isDirectory()) { Serial.println("/"); printDirectory(entry, numTabs + 1); } else { // files have sizes, directories do not Serial.print("\t\t"); Serial.println(entry.size(), DEC); } entry.close(); } } void setup() { Serial.begin(74880); Serial.println("Starting."); Serial.println("Setting up SPI..."); SPI.begin(); SPIMaster::init(); sd = new SDCard(); player = new Player(sd); controller = new Controller(player, sd); buttons = new Buttons(controller); } void loop() { }