Init Shared Repo

This commit is contained in:
Joe Tretter
2020-09-21 17:57:22 -05:00
commit f5a2b6b0ae
7 changed files with 186 additions and 0 deletions

63
src/BigFile.cpp Normal file
View File

@@ -0,0 +1,63 @@
#include "SPIFFS.h"
File file;
void setup()
{
Serial.begin(115200);
delay(2000);
if (!SPIFFS.begin(true))
{
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
Serial.print("SPIFFS: Total:");
Serial.print(SPIFFS.totalBytes());
Serial.print("/Used:");
Serial.println(SPIFFS.usedBytes());
Serial.print("Trying delete:");
Serial.println(SPIFFS.remove("/test.txt"));
file = SPIFFS.open("/test.txt", FILE_WRITE);
if (!file)
{
Serial.println("There was an error opening the file for writing");
return;
}
// file.close();
}
long i = 0, numw = 0;
void loop()
{
if (file.print("X"))
{
i++;
/* if (0==i%1024) {
Serial.print(i/1024);
Serial.print("/");
} */
}
else
{
Serial.print("File write failed on pos: ");
Serial.print(i);
Serial.print(" / ");
Serial.println(++numw);
file.close();
Serial.print("Trying delete:");
Serial.println(SPIFFS.remove("/test.txt"));
file = SPIFFS.open("/test.txt", FILE_WRITE);
i = 0;
}
}