Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make loopSD open on /BruceRFID folder directly for rfid applications #678

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/modules/rfid/RFID2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ int RFID2::load() {
FS *fs;

if(!getFsStorage(fs)) return FAILURE;
filepath = loopSD(*fs, true, "RFID|NFC");
if (!(*fs).exists("/BruceRFID")) (*fs).mkdir("/BruceRFID");
filepath = loopSD(*fs, true, "RFID|NFC", "/BruceRFID");
file = fs->open(filepath, FILE_READ);

if (!file) {
Expand Down
3 changes: 2 additions & 1 deletion src/modules/rfid/amiibo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ bool Amiibo::openDumpFile() {
return false;
}

filepath = loopSD(*fs, true, "RFID|NFC");
if (!(*fs).exists("/BruceRFID")) (*fs).mkdir("/BruceRFID");
filepath = loopSD(*fs, true, "RFID|NFC", "/BruceRFID");
file = fs->open(filepath, FILE_READ);

if (!file) {
Expand Down
6 changes: 4 additions & 2 deletions src/modules/rfid/chameleon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ bool Chameleon::readFileLF() {
FS *fs;

if(!getFsStorage(fs)) return false;
filepath = loopSD(*fs, true, "RFIDLF");
if (!(*fs).exists("/BruceRFID")) (*fs).mkdir("/BruceRFID");
filepath = loopSD(*fs, true, "RFIDLF", "/BruceRFID");
file = fs->open(filepath, FILE_READ);

if (!file) {
Expand Down Expand Up @@ -826,7 +827,8 @@ bool Chameleon::readFileHF() {
FS *fs;

if(!getFsStorage(fs)) return false;
filepath = loopSD(*fs, true, "RFID|NFC");
if (!(*fs).exists("/BruceRFID")) (*fs).mkdir("/BruceRFID");
filepath = loopSD(*fs, true, "RFID|NFC", "/BruceRFID");
file = fs->open(filepath, FILE_READ);

if (!file) {
Expand Down
9 changes: 6 additions & 3 deletions src/modules/rfid/pn532ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,8 @@ void Pn532ble::loadMifareClassicDumpFile()
padprintln("No storage found");
return;
}
String filePath = loopSD(*fs, true, "bin");
if (!(*fs).exists("/BruceRFID")) (*fs).mkdir("/BruceRFID");
String filePath = loopSD(*fs, true, "bin", "/BruceRFID");
if (filePath == "")
{
padprintln("No file selected");
Expand Down Expand Up @@ -1393,7 +1394,8 @@ void Pn532ble::loadMifareUltralightDumpFile()
padprintln("No storage found");
return;
}
String filePath = loopSD(*fs, true, "bin");
if (!(*fs).exists("/BruceRFID")) (*fs).mkdir("/BruceRFID");
String filePath = loopSD(*fs, true, "bin", "/BruceRFID");
if (filePath == "")
{
padprintln("No file selected");
Expand Down Expand Up @@ -1460,7 +1462,8 @@ void Pn532ble::loadIso15693DumpFile()
padprintln("No storage found");
return;
}
String filePath = loopSD(*fs, true, "bin");
if (!(*fs).exists("/BruceRFID")) (*fs).mkdir("/BruceRFID");
String filePath = loopSD(*fs, true, "bin", "/BruceRFID");
if (filePath == "")
{
padprintln("No file selected");
Expand Down
Loading