-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
86 changed files
with
27,509 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[bumpversion] | ||
current_version = 1.5.5 | ||
commit = True | ||
tag = True | ||
|
||
[bumpversion:file:README.md] | ||
search = littlefs=={current_version} | ||
replace = littlefs=={new_version} | ||
|
||
[bumpversion:file:idf_component.yml] | ||
search = "{current_version}" | ||
replace = "{new_version}" | ||
|
||
[bumpversion:file(number):include/esp_littlefs.h] | ||
search = ESP_LITTLEFS_VERSION_NUMBER "{current_version}" | ||
replace = ESP_LITTLEFS_VERSION_NUMBER "{new_version}" | ||
|
||
[bumpversion:file(major):include/esp_littlefs.h] | ||
parse = (?P<major>\d+) | ||
serialize = {major} | ||
search = ESP_LITTLEFS_VERSION_MAJOR {current_version} | ||
replace = ESP_LITTLEFS_VERSION_MAJOR {new_version} | ||
|
||
[bumpversion:file(minor):include/esp_littlefs.h] | ||
parse = (?P<minor>\d+) | ||
serialize = {minor} | ||
search = ESP_LITTLEFS_VERSION_MINOR {current_version} | ||
replace = ESP_LITTLEFS_VERSION_MINOR {new_version} | ||
|
||
[bumpversion:file(patch):include/esp_littlefs.h] | ||
parse = (?P<patch>\d+) | ||
serialize = {patch} | ||
search = ESP_LITTLEFS_VERSION_PATCH {current_version} | ||
replace = ESP_LITTLEFS_VERSION_PATCH {new_version} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
build/ | ||
sdkconfig | ||
sdkconfig.old | ||
|
||
example/build/ | ||
example/sdkconfig | ||
example/sdkconfig.old | ||
example/dependencies.lock | ||
|
||
*.DS_Store | ||
*/.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "main/littlefs"] | ||
path = src/littlefs | ||
url = https://github.com/littlefs-project/littlefs.git | ||
[submodule "mklittlefs"] | ||
path = mklittlefs | ||
url = https://github.com/BrianPugh/mklittlefs.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
file(GLOB SOURCES src/littlefs/*.c) | ||
list(APPEND SOURCES src/esp_littlefs.c src/littlefs_api.c src/lfs_config.c) | ||
|
||
if(IDF_VERSION_MAJOR GREATER_EQUAL 5) | ||
list(APPEND pr esp_partition) | ||
endif() | ||
|
||
idf_component_register( | ||
SRCS ${SOURCES} | ||
INCLUDE_DIRS include | ||
PRIV_INCLUDE_DIRS src | ||
PRIV_REQUIRES ${pr} esptool_py spi_flash vfs | ||
) | ||
|
||
set_source_files_properties( | ||
${SOURCES} | ||
PROPERTIES COMPILE_FLAGS "-DLFS_CONFIG=lfs_config.h" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
menu "LittleFS" | ||
|
||
config LITTLEFS_MAX_PARTITIONS | ||
int "Maximum Number of Partitions" | ||
default 3 | ||
range 1 10 | ||
help | ||
Define maximum number of partitions that can be mounted. | ||
|
||
config LITTLEFS_PAGE_SIZE | ||
int "LITTLEFS logical page size" | ||
default 256 | ||
range 256 1024 | ||
help | ||
Logical page size of LITTLEFS partition, in bytes. Must be multiple | ||
of flash page size (which is usually 256 bytes). | ||
Larger page sizes reduce overhead when storing large files, and | ||
improve filesystem performance when reading large files. | ||
Smaller page sizes reduce overhead when storing small (< page size) | ||
files. | ||
|
||
config LITTLEFS_OBJ_NAME_LEN | ||
int "Maximum object name length including NULL terminator." | ||
default 64 | ||
range 16 1022 | ||
help | ||
Includes NULL-terminator. If flashing a prebuilt filesystem image, | ||
rebuild the filesystem image if this value changes. | ||
mklittlefs, the tool that generates the image will automatically be rebuilt. | ||
If downloading a pre-built release of mklittlefs, it was most-likely | ||
built with LFS_NAME_MAX=32 and should not be used. | ||
|
||
config LITTLEFS_READ_SIZE | ||
int "Minimum size of a block read." | ||
default 128 | ||
help | ||
Minimum size of a block read. All read operations will be a | ||
multiple of this value. | ||
|
||
config LITTLEFS_WRITE_SIZE | ||
int "Minimum size of a block write." | ||
default 128 | ||
help | ||
Minimum size of a block program. All write operations will be a | ||
multiple of this value. | ||
|
||
config LITTLEFS_LOOKAHEAD_SIZE | ||
int "Look ahead size." | ||
default 128 | ||
help | ||
Look ahead size. Must be a multiple of 8. | ||
|
||
config LITTLEFS_CACHE_SIZE | ||
int "Cache Size" | ||
default 512 | ||
help | ||
Size of block caches. Each cache buffers a portion of a block in RAM. | ||
The littlefs needs a read cache, a program cache, and one additional | ||
cache per file. Larger caches can improve performance by storing more | ||
data and reducing the number of disk accesses. Must be a multiple of | ||
the read and program sizes, and a factor of the block size (4096). | ||
|
||
config LITTLEFS_BLOCK_CYCLES | ||
int "LittleFS wear-leveling block cycles" | ||
default 512 | ||
range -1 1024 | ||
help | ||
Number of erase cycles before littlefs evicts metadata logs and moves | ||
the metadata to another block. Suggested values are in the | ||
range 100-1000, with large values having better performance at the cost | ||
of less consistent wear distribution. | ||
Set to -1 to disable block-level wear-leveling. | ||
|
||
config LITTLEFS_USE_MTIME | ||
bool "Save file modification time" | ||
default "y" | ||
help | ||
Saves timestamp on modification. Uses an additional 4bytes. | ||
|
||
config LITTLEFS_USE_ONLY_HASH | ||
bool "Don't store filepath in the file descriptor" | ||
default "n" | ||
help | ||
Records the filepath only as a 32-bit hash in the file descriptor instead | ||
of the entire filepath. Saves approximately `sizeof(filepath)` bytes | ||
per file descriptor. | ||
If enabled, functionality (like fstat) that requires the file path | ||
from the file descriptor will not work. | ||
In rare cases, may cause unlinking or renaming issues (unlikely) if | ||
there's a hash collision between an open filepath and a filepath | ||
to be modified. | ||
|
||
config LITTLEFS_HUMAN_READABLE | ||
bool "Make errno human-readable" | ||
default "n" | ||
help | ||
Converts LittleFS error codes into human readable strings. | ||
May increase binary size depending on logging level. | ||
|
||
choice LITTLEFS_MTIME | ||
prompt "mtime attribute options" | ||
depends on LITTLEFS_USE_MTIME | ||
default LITTLEFS_MTIME_USE_SECONDS | ||
help | ||
Save an additional 4-byte attribute. Options listed below. | ||
|
||
config LITTLEFS_MTIME_USE_SECONDS | ||
bool "Use Seconds" | ||
help | ||
Saves timestamp on modification. | ||
|
||
config LITTLEFS_MTIME_USE_NONCE | ||
bool "Use Nonce" | ||
help | ||
Saves nonce on modification; intended for detecting filechanges | ||
on systems without access to a RTC. | ||
|
||
A file who's nonce is the same as it was at a previous time has | ||
high probability of not having been modified. | ||
|
||
Upon file modification, the nonce is incremented by one. Upon file | ||
creation, a random nonce is assigned. | ||
|
||
There is a very slim chance that a file will have the same nonce if | ||
it is deleted and created again (approx 1 in 4 billion). | ||
|
||
endchoice | ||
|
||
config LITTLEFS_SPIFFS_COMPAT | ||
bool "Improve SPIFFS drop-in compatability" | ||
default "n" | ||
help | ||
Enabling this feature allows for greater drop-in compatability | ||
when replacing SPIFFS. Since SPIFFS doesn't have folders, and | ||
folders are just considered as part of a file name, enabling this | ||
will automatically create folders as necessary to create a file | ||
instead of throwing an error. Similarly, upon the deletion of the | ||
last file in a folder, the folder will be deleted. It is recommended | ||
to only enable this flag as a stop-gap solution. | ||
|
||
config LITTLEFS_FLUSH_FILE_EVERY_WRITE | ||
bool "Flush file to flash after each write operation" | ||
default "n" | ||
help | ||
Enabling this feature extends SPIFFS capability. | ||
In SPIFFS data is written immediately to the flash storage when fflush() function called. | ||
In LittleFS flush() does not write data to the flash, and fsync() call needed after. | ||
With this feature fflush() will write data to the storage. | ||
|
||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2020 Brian Pugh | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
PROJECT_NAME := littlefs | ||
|
||
EXTRA_COMPONENT_DIRS := \ | ||
$(abspath .) \ | ||
$(abspath unit_tester) \ | ||
$(IDF_PATH)/tools/unit-test-app/components/ | ||
|
||
CFLAGS += \ | ||
-Werror | ||
|
||
include $(IDF_PATH)/make/project.mk | ||
|
||
.PHONY: tests | ||
|
||
tests-build: | ||
$(MAKE) \ | ||
TEST_COMPONENTS='src' | ||
|
||
tests: | ||
$(MAKE) \ | ||
TEST_COMPONENTS='src' \ | ||
flash monitor; | ||
|
||
tests-enc: | ||
$(MAKE) \ | ||
TEST_COMPONENTS='src' \ | ||
encrypted-flash monitor; | ||
|
Oops, something went wrong.