#include #include #include #include "config.h" #include "controller.h" #include "player.h" #include "spi_master.h" Controller* controller; Player* player; void setup() { delay(500); Serial.begin(74880); Serial.println("Starting."); Serial.println("Setting up SPI..."); SPI.begin(); SPIMaster::init(); SPIMaster::enable(PIN_SD_CS); if (SD.begin(PIN_SD_CS)) { Serial.println("SD card initialized."); } else { Serial.println("Could not initialize SD card. Halting."); while(1); } player = new Player(); controller = new Controller(player); //player->play_album("12345678"); } void loop() { bool more_data_needed = player->loop(); if (more_data_needed) return; controller->loop(); }