1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

17 Commits

Author SHA1 Message Date
Dirk Mueller
59873908c4
Use direct member initialization instead of ctr initialisation (#7556)
This removes a bit of code repetition.
2020-08-28 10:23:05 -04:00
Earle F. Philhower, III
a389a995fb Add LittleFS as an optional filesystem, API compatible w/SPIFFS (but not on-flash-format compatible) (#5511)
* Add LittleFS as internal flash filesystem

Adds a LittleFS object which uses the ARMmbed littlefs embedded filesystem,
https://github.com/ARMmbed/littlefs, to enable a new filesystem for onboard
flash utilizing the exact same API as the existing SPIFFS filesystem.

LittleFS is built for low memory systems that are subject to random power
losses, is actively supported by the ARMmbed community, supports directories,
and seems to be much faster in the large-ish read-mostly applications I use.

LittleFS, however, has a larger minimum file allocation unit and does not do
static wear levelling.  This means that for systems that need many little
files (<4K), have small SPIFFS areas (64K), or which have a large static
set of files covering the majority of flash coupled with a frequently
updated set of other files, it may not perform as well.

Simply replace SPIFFS.begin() with LittleFS.begin() in your sketch,
use LittleFS.open in place of SPIFFS.open to open files, and everything
else just works thanks to the magic of @igrr's File base class.

**LITTLEFS FLASH LAYOUT IS INCOMPATIBLE WITH SPIFFS**
Since it is a completely different filesystem, you will need to reformat
your flash (and lose any data therein) to use it. Tools to build the
flash filesystem and upload are at
https://github.com/earlephilhower/arduino-esp8266littlefs-plugin and
https://github.com/earlephilhower/mklittlefs/ .  The mklittlefs tool
is installed as part of the Arduino platform installation, automatically.

The included example shows a contrived read-mostly example and
demonstrates how the same calls work on either SPIFFS.* or LittleFS.*
Host tests are also included as part of CI.

Directories are fully supported in LittleFS. This means that LittleFS
will have a slight difference vs. SPIFFS when you use
LittleFS.openDir()/Dir.next().  On SPIFFS dir.next()
will return all filesystem entries, including ones in "subdirs"
(because in SPIFFS there are no subdirs and "/" is the same as any
other character in a filename).

On LittleFS, dir.next() will only return entries in the directory
specified, not subdirs.  So to list files in "/subdir/..." you need
to actually openDir("/subdir") and use Dir.next() to parse through
just those elements.  The returned filenames also only have the
filename returned, not full paths.  So on a FS with "/a/1", "/a/2"
when you do openDir("/a"); dir.next().getName(); you get "1" and "2"
and not "/a/1" and "/a/2" like in SPIFFS.  This is consistent with
POSIX ideas about reading directories and more natural for a FS.

Most code will not be affected by this, but if you depend on
openDir/Dir.next() you need to be aware of it.

Corresponding ::mkdir, ::rmdir, ::isDirectory, ::isFile,
::openNextFile, and ::rewind methods added to Filesystem objects.
Documentation has been updated with this and other LittleFS information.

Subdirectories are made silently when they do not exist when you
try and create a file in a subdir.  They are silently removed when
the last file in them is deleted.  This is consistent with what
SPIFFS does but is obviously not normal POSIX behavior.  Since there
has never been a "FS.mkdir()" method this is the only way to be
compatible with legacy SPIFFS code.

SPIFFS code has been refactored to pull out common flash_hal_* ops
and placed in its own namespace, like LittleFS.

* Fix up merge blank line issue

* Merge in the FSConfig changs from SDFS PR

Enable setConfig for LittleFS as well plys merge the SPIFFS changes
done in the SDFS PR.

* Fix merge errors

* Update to use v2-alpha branch

The V2-alpha branch supports small file optimizations which can help
increase the utilization of flash when small files are prevalent.
It also adds support for metadata, which means we can start adding
things like file creation times, if desired (not yet).

* V2 of littlefs is now in upstream/master

* Update test to support non-creation-ordered files

In a directory, the order in which "readNextFile()" will return a name
is undefined.  SPIFFS may return it in order, but LittleFS does not as
of V2.  Update the test to look for files by name when doing
readNextFile() testing.

* Fix LittleFS.truncate implementation

* Fix SDFS tests

SDFS, SPIFFS, and LittleFS now all share the same common set of tests,
greatly increasing the SDFS test coverage.

* Update to point to mklittlefs v2

Upgrade mklittlefs to V2 format support

* Remove extra FS::write(const char *s) method

This was removed in #5861 and erroneously re-introduced here.

* Minimize spurious differences from master

* Dramatically reduce memory usage

Reduce the program and read chunk sizes which impacts performance
minimally but reduces per-file RAM usage of 16KB to <1KB.

* Add @d-a-v's host emulation for LittleFS

* Fix SW Serial library version

* Fix free space reporting

Thanks to @TD-er for discovering the issue

* Update littlefs to latest upstream

* Remove sdfat version included by accident

* Update SDFAT to include MOCK changes required

* Update to include SD.h test of file append
2019-05-25 09:53:24 +02:00
Allman-astyler
eea9999dc5 Revert "Allman now (#6080)" (#6090)
This reverts commit 98125f88605cd7e46e9be4e1b3ad0600dd5d2b51.
2019-05-14 00:09:54 +02:00
Allman-astyler
98125f8860 Allman now (#6080)
* switch restyle script for CI

* remove confirmation

* restyle with allman
2019-05-13 16:41:34 +02:00
Develo
e9d052c621
WIP - Update ArduinoOTA and examples with MDNS.update() calls (#5494)
* ArduinoOTA: allow use without MDNS, add MDNS.update() in handle()

* Update examples with MDNS.update() in loop

* Update CaptivePortalAdvanced.ino

Fix typo

* Update CaptivePortalAdvanced.ino

astyle

* Update Arduino_Wifi_AVRISP.ino

astyle
2018-12-14 03:29:32 -03:00
Ivan Grokhotkov
03baea27ef ArduinoOTA: forward errors from Update.begin to espota.py
If Update.begin fails, instead of printing “No response from device”,
espota.py will print the actual error message from the Updater.
2017-05-09 06:17:06 -05:00
Me No Dev
889775c6fe ArduinoOTA optimizations (#2445)
- Added option to control if the ESP should be rebooted on success
- Added delay before ESP.restart() is called
- Added some comments to the header
2016-08-27 18:32:26 +03:00
Clemens Kirchgatterer
18297458be allows global object instances be switch off with defines (#2344) 2016-08-01 11:21:50 +08:00
Me No Dev
e83f30a78d Ota hashed password (#2292)
* Add option to give ArduinoOTA a hashed value of the password

hashed password can be safely stored on flash

* Switch to separate method to accept the hash

* Calculate the hash of plain passwords at setup

* missed line

* Remove underscores from local variable
2016-07-18 19:28:56 +08:00
andig
c4f9f102ce Add getCommand() api for OTA update type (#2259) 2016-07-15 11:03:34 +03:00
NullMedia
d60d744b59 ArduinoOTA library change (#2013)
* Fixed callbacks to allow lambda capture

* Update ArduinoOTA.cpp

* Fixed callbacks to allow lambda capture

* Fixed callbacks to allow lambda capture

* Update ArduinoOTA.h

* Tests update

Update ArduinoOTA.h

Fixed callbacks to allow lambda capture

* Modified callbacks to enable lambda capture

* Modified callbacks to enable lambda capture
2016-06-01 11:10:29 +08:00
Yuichi Tateno
cffdd55759 Add ArduinoOTA::getHostname() interface 2016-05-22 18:17:23 +09:00
Stavros Korokithakis
e9f2f1c989 Fix typo. 2015-11-28 16:37:36 +02:00
Me No Dev
d2982d3555 Make ArduinoOTA AUTH async
still up to the user to call ArduinoOTA.handle() to start the upload
2015-11-19 22:49:40 +02:00
Ivan Grokhotkov
92069e657b Replace some manually managed buffers with Strings, fix code style 2015-11-11 01:07:02 +03:00
Me No Dev
a8976a01fd Add MD5 to core, Fix OTA examples and Digest Authentication to OTA and espota.py 2015-11-09 00:42:30 +02:00
Miguel Angel Ajo
6978b6a777 OTA support encapsulated to ArduinoOTA class 2015-10-12 10:29:18 +02:00