Added sleep mode for VS1053, HTTP server, tar upload, JSON status, RFID card removal debouncing, ...

This commit is contained in:
2019-08-12 20:15:00 +02:00
parent cd4251df86
commit 651a4e8510
8 changed files with 286 additions and 13 deletions

View File

@ -6,16 +6,20 @@
#include "controller.h"
#include "player.h"
#include "spi_master.h"
#include "http_server.h"
Controller* controller;
Player* player;
MCP* mcp;
HTTPServer* http_server;
void setup() {
delay(500);
Serial.begin(74880);
INFO("Starting.\n");
INFO("Initializing...\n");
DEBUG("Setting up SPI...\n");
SPI.begin();
@ -35,8 +39,14 @@ void setup() {
ERROR("Could not initialize SD card. Halting.\n");
while(1);
}
DEBUG("Initializing Player and Controller...\n");
player = new Player(mcp);
controller = new Controller(player, mcp);
INFO("Player and controller initialized.\n");
DEBUG("Setting up WiFi and web server...\n");
http_server = new HTTPServer(player, controller);
INFO("Initialization completed.\n");
}
@ -46,4 +56,5 @@ void loop() {
if (more_data_needed) return;
controller->loop();
http_server->loop();
}