From 92edaca309f180bbdb3a9f89902ed40672c88ea6 Mon Sep 17 00:00:00 2001 From: radex Date: Fri, 31 May 2024 23:44:39 +0200 Subject: [PATCH] test: comment out old sd implementation --- firmware/platformio.ini | 2 +- firmware/src/sd.cpp | 27 ++++++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/firmware/platformio.ini b/firmware/platformio.ini index 864bc9d..1013144 100644 --- a/firmware/platformio.ini +++ b/firmware/platformio.ini @@ -13,5 +13,5 @@ platform = raspberrypi board = pico framework = arduino lib_deps = - khoih-prog/RP2040_SD@^1.0.1 + ; khoih-prog/RP2040_SD@^1.0.1 diff --git a/firmware/src/sd.cpp b/firmware/src/sd.cpp index d8c961f..e7d47b4 100644 --- a/firmware/src/sd.cpp +++ b/firmware/src/sd.cpp @@ -1,6 +1,6 @@ #include #include -#include +// #include #include "sd.h" #include "audio.h" #include "gfx_decoder.h" @@ -34,12 +34,15 @@ bool isSDCardInserted() { return digitalRead(SD_DET_PIN) == LOW; } +/* void printSDConfig(); void testSDCard(); void printSDStats(); void printDirectory(File dir, int numTabs); +*/ void setupSD() { + /* SPI.begin(); // printSDConfig(); @@ -59,8 +62,10 @@ void setupSD() { // File root = SD.open("/"); // printDirectory(root, 0); + */ } +/* void printSDConfig() { Serial.println(BOARD_NAME); Serial.println(RP2040_SD_VERSION); @@ -155,11 +160,12 @@ void printSDStats(RP2040_SdVolume volume) { Serial.print("Volume size (GB): "); Serial.println((float)volumesize / 1024.0); } - +*/ String playlist[128] = {}; size_t playlistSize = 0; void sd_loadPlaylist() { + /* auto path = "video/playlist.txt"; if (!SD.exists(path)) { @@ -220,11 +226,13 @@ void sd_loadPlaylist() { Serial.print(": "); Serial.println(playlist[i]); } + */ } -File audioFile; +// File audioFile; void sd_loadAudio(size_t index) { + /* if (index >= playlistSize) { Serial.println("Index out of range"); return; @@ -258,9 +266,11 @@ void sd_loadAudio(size_t index) { } audio_start(); + */ } void sd_loadNextAudio() { + /* if (!next_buffer_requested) { return; } @@ -282,11 +292,13 @@ void sd_loadNextAudio() { Serial.print(" bytes from audio file in "); Serial.print(millis() - b4); Serial.println("ms"); - */ + * / } + */ } bool sd_loadGfxFrameLengths(size_t index) { + /* if (index >= playlistSize) { Serial.println("Index out of range"); return false; @@ -317,13 +329,15 @@ bool sd_loadGfxFrameLengths(size_t index) { Serial.println("Done reading frame lengths"); return true; + */ } -File gfxFile; +// File gfxFile; uint16_t frameIdx = 0; bool sd_loadGfxBlob(size_t index) { + /* if (index >= playlistSize) { Serial.println("Index out of range"); return false; @@ -342,10 +356,12 @@ bool sd_loadGfxBlob(size_t index) { frameIdx = 0; return true; + */ } // Returns size of frame read or -1 if error int32_t sd_loadNextFrame() { + /* if (frameIdx > 0) { // return -1; } @@ -386,4 +402,5 @@ int32_t sd_loadNextFrame() { } return frameSize; + */ }