1
0
Fork 0

test: comment out old sd implementation

sd2
radex 2024-05-31 23:44:39 +02:00
parent 99f4f36d31
commit 92edaca309
Signed by: radex
SSH Key Fingerprint: SHA256:hvqRXAGG1h89yqnS+cyFTLKQbzjWD4uXIqw7Y+0ws30
2 changed files with 23 additions and 6 deletions

View File

@ -13,5 +13,5 @@ platform = raspberrypi
board = pico board = pico
framework = arduino framework = arduino
lib_deps = lib_deps =
khoih-prog/RP2040_SD@^1.0.1 ; khoih-prog/RP2040_SD@^1.0.1

View File

@ -1,6 +1,6 @@
#include <Arduino.h> #include <Arduino.h>
#include <SPI.h> #include <SPI.h>
#include <RP2040_SD.h> // #include <RP2040_SD.h>
#include "sd.h" #include "sd.h"
#include "audio.h" #include "audio.h"
#include "gfx_decoder.h" #include "gfx_decoder.h"
@ -34,12 +34,15 @@ bool isSDCardInserted() {
return digitalRead(SD_DET_PIN) == LOW; return digitalRead(SD_DET_PIN) == LOW;
} }
/*
void printSDConfig(); void printSDConfig();
void testSDCard(); void testSDCard();
void printSDStats(); void printSDStats();
void printDirectory(File dir, int numTabs); void printDirectory(File dir, int numTabs);
*/
void setupSD() { void setupSD() {
/*
SPI.begin(); SPI.begin();
// printSDConfig(); // printSDConfig();
@ -59,8 +62,10 @@ void setupSD() {
// File root = SD.open("/"); // File root = SD.open("/");
// printDirectory(root, 0); // printDirectory(root, 0);
*/
} }
/*
void printSDConfig() { void printSDConfig() {
Serial.println(BOARD_NAME); Serial.println(BOARD_NAME);
Serial.println(RP2040_SD_VERSION); Serial.println(RP2040_SD_VERSION);
@ -155,11 +160,12 @@ void printSDStats(RP2040_SdVolume volume) {
Serial.print("Volume size (GB): "); Serial.print("Volume size (GB): ");
Serial.println((float)volumesize / 1024.0); Serial.println((float)volumesize / 1024.0);
} }
*/
String playlist[128] = {}; String playlist[128] = {};
size_t playlistSize = 0; size_t playlistSize = 0;
void sd_loadPlaylist() { void sd_loadPlaylist() {
/*
auto path = "video/playlist.txt"; auto path = "video/playlist.txt";
if (!SD.exists(path)) { if (!SD.exists(path)) {
@ -220,11 +226,13 @@ void sd_loadPlaylist() {
Serial.print(": "); Serial.print(": ");
Serial.println(playlist[i]); Serial.println(playlist[i]);
} }
*/
} }
File audioFile; // File audioFile;
void sd_loadAudio(size_t index) { void sd_loadAudio(size_t index) {
/*
if (index >= playlistSize) { if (index >= playlistSize) {
Serial.println("Index out of range"); Serial.println("Index out of range");
return; return;
@ -258,9 +266,11 @@ void sd_loadAudio(size_t index) {
} }
audio_start(); audio_start();
*/
} }
void sd_loadNextAudio() { void sd_loadNextAudio() {
/*
if (!next_buffer_requested) { if (!next_buffer_requested) {
return; return;
} }
@ -282,11 +292,13 @@ void sd_loadNextAudio() {
Serial.print(" bytes from audio file in "); Serial.print(" bytes from audio file in ");
Serial.print(millis() - b4); Serial.print(millis() - b4);
Serial.println("ms"); Serial.println("ms");
*/ * /
} }
*/
} }
bool sd_loadGfxFrameLengths(size_t index) { bool sd_loadGfxFrameLengths(size_t index) {
/*
if (index >= playlistSize) { if (index >= playlistSize) {
Serial.println("Index out of range"); Serial.println("Index out of range");
return false; return false;
@ -317,13 +329,15 @@ bool sd_loadGfxFrameLengths(size_t index) {
Serial.println("Done reading frame lengths"); Serial.println("Done reading frame lengths");
return true; return true;
*/
} }
File gfxFile; // File gfxFile;
uint16_t frameIdx = 0; uint16_t frameIdx = 0;
bool sd_loadGfxBlob(size_t index) { bool sd_loadGfxBlob(size_t index) {
/*
if (index >= playlistSize) { if (index >= playlistSize) {
Serial.println("Index out of range"); Serial.println("Index out of range");
return false; return false;
@ -342,10 +356,12 @@ bool sd_loadGfxBlob(size_t index) {
frameIdx = 0; frameIdx = 0;
return true; return true;
*/
} }
// Returns size of frame read or -1 if error // Returns size of frame read or -1 if error
int32_t sd_loadNextFrame() { int32_t sd_loadNextFrame() {
/*
if (frameIdx > 0) { if (frameIdx > 0) {
// return -1; // return -1;
} }
@ -386,4 +402,5 @@ int32_t sd_loadNextFrame() {
} }
return frameSize; return frameSize;
*/
} }