1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Deprecate SPIFFS, move examples to LittleFS (#7263)

* Deprecate SPIFFS, move examples to LittleFS

SPIFFS has been a great filesystem, but it has significant problems in
many cases (and it's also pretty slow).  Development seems to have
slowed/stopped on the upstream version, and we're not able to provide
support or fix the known issues with it as-is.

Deprecate SPIFFS variable.

Update all examples to use LittleFS instead of SPIFFS.

Also, minor cleanup on very old examples which has obsolete delays
waiting for the Serial port to come up, or which were stuck at 9600 baud
because of their ancient AVR heritage.

Fixes #7095

* Remove leftover debug code

* Clean up comments in some examples

* Update documentation on SPIFFS deprecation

* Fix host tests to avoid deprecation warnings

* Fix cut-n-paste error

* Restore SpeedTest.ino, adjust to allow custom FSes

Co-authored-by: Develo <deveyes@gmail.com>
This commit is contained in:
Earle F. Philhower, III
2020-05-04 11:22:50 -07:00
committed by GitHub
parent 9845deb283
commit 83166f948b
40 changed files with 176 additions and 164 deletions

View File

@ -16,15 +16,16 @@
#include <catch.hpp>
#include <string.h>
#include <FS.h>
#include "../common/spiffs_mock.h"
#include <LittleFS.h>
#include "../common/littlefs_mock.h"
#include <spiffs/spiffs.h>
// Use a SPIFFS file because we can't instantiate a virtual class like Print
// Use a LittleFS file because we can't instantiate a virtual class like Print
TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512, "");
REQUIRE(SPIFFS.begin());
auto p = SPIFFS.open("test.bin", "w");
LITTLEFS_MOCK_DECLARE(64, 8, 512, "");
REQUIRE(LittleFS.begin());
auto p = LittleFS.open("test.bin", "w");
REQUIRE(p);
uint8_t uint8 = 1;
uint16_t uint16 = 2;
@ -56,7 +57,7 @@ TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
p.write(1);
p.close();
p = SPIFFS.open("test.bin", "r");
p = LittleFS.open("test.bin", "r");
REQUIRE(p);
uint8_t buff[16];
int len = p.read(buff, 16);