Commit Graph
149 Commits
Author SHA1 Message Date
Sosthène Guédon 0ce776d6e4 Fix list panic when last block of the filesystem is used 2025-03-07 16:54:48 +01:00
Robin Krahl bc4b4543f1 Release v0.6.0 0.6.0 2025-02-28 13:38:54 +01:00
Robin Krahl 9fdeadcf0f Remove trait and result arguments from macros
The const_ram_storage! and ram_storage! macros used to have trait and
result arguments to set the storage trait to implement and the result
type to use.  As this defaulted to relative paths, it made the result of
the macro dependent on the context and could cause confusion.  At the
same time, there is no real use case for substituting these types.

This patch removes the arguments for good and just uses
$crate::driver::Storage and $crate::io::Result instead.
2025-02-28 13:18:15 +01:00
Robin Krahl 49d15bc0cf Introduce version constants and use correct disk version
This patch replaces the version function with two constants,
BACKEND_VERSION and DISK_VERSION, and changes the Version struct to be
a wrapper for a littlefs version number.  DISK_VERSION is now the disk
version used by this crate, not the newest version supported by the
backend.
2025-02-27 16:36:03 +01:00
Sosthène GuédonandRobin Krahl 3bd9e1743b Bump littlefs to version 2.9 2025-02-27 16:36:03 +01:00
Robin Krahl 25c88f8093 ci: Use avr-none target for avr build
avr-none is now a supported Tier 3 target so we no longer need the
custom target definition.
2025-02-26 14:56:48 +01:00
Robin Krahl 341d3de6d3 Add missing log-trace feature to Cargo.toml
This fixes a new compiler warning for unexpected cfgs.
2025-02-26 12:09:02 +01:00
Robin Krahl c31e789cd7 Release littlefs2-core v0.1.1 core-0.1.1 2025-01-16 16:41:11 +01:00
Robin Krahl de820834f0 core: Add path_buf macro
We already have the path macro and PathBuf::from_path.  Having a
separate path_buf macro makes the code more readable and ensures
compile-time evaluation.
2025-01-16 16:41:09 +01:00
Robin Krahl 51cae4d5fd core: Make Path and PathBuf more const-friendly
This patch makes Path and PathBuf more const-friendly by adding some new
const methods and marking existing methods as const.
2025-01-16 16:24:36 +01:00
Robin Krahl 45e87d5e25 Remove empty line after doc comment
This fixes a new clippy lint.
2025-01-07 12:25:28 +01:00
Robin Krahl b868aa6c92 Remove unnecessary explicit lifetimes
This fixes a new clippy lint.
2025-01-07 12:25:07 +01:00
Robin Krahl 62afcd88fc Add list example
This patch adds an example that reads a filesystem image from a file and
prints its content.
2024-11-17 21:40:45 +01:00
Robin Krahl 0a22aa1101 Release v0.5.0 0.5.0 2024-10-25 10:57:54 +02:00
Robin Krahl 7614f8e18b Handle platforms where c_int is not i32
Some functions assume that c_int is always i32.  This is not true for
all platforms.  This patch adapts those functions to handle those cases.

Some littlefs functions return an error code (c_int) from functions
returning i32.  In these cases, error codes are truncated to c_int::MIN.
2024-10-22 17:00:42 +02:00
Robin Krahl 0988ecd8a8 Add CI job for avr target 2024-10-22 16:58:41 +02:00
Robin Krahl 0d753af154 Release littlefs2-core v0.1.0 core-0.1.0 2024-10-17 10:58:24 +02:00
Robin Krahl d86f5fa7ab core: Never inline Path to PathBuf conversion 2024-10-15 14:07:51 +02:00
Robin Krahl bea46411a1 core: Remove debug information from Error
If unwrap or expect is used on a Result<_, Error>, the Debug
implementation is not always optimized out.  This leads to a significant
increase of the binary size. As a short-term fix, this patch changes the
Debug implementation to always returns a static string.
2024-10-14 21:23:41 +02:00
Robin Krahl a1f8d9e87b core: Add support for heapless-bytes
Similar to the existing support for multiple heapless versions, this
patch also adds support for heapless-bytes 0.3 and 0.4.
2024-09-13 11:44:54 +02:00
Robin Krahl 932a40f2da core: Make heapless support optional and support multiple versions
The DynFile::read_to_end, DynFilesystem::read and
DynFilesystem::read_chunk methods use a heapless::Vec to store a
flexible amount of data.  This patch introduces a Vec trait that
abstracts over different versions of heapless so that we can optionally
support multiple heapless versions at the same time.

Fixes: https://github.com/trussed-dev/littlefs2/issues/77
2024-09-13 11:44:33 +02:00
Robin Krahl e225f060e5 Remove unnecessary clone in ReadDir 2024-09-13 11:04:13 +02:00
Robin Krahl 69ff97406d Remove dir-entry-path feature
The dir-entry-path feature has been enabled by default and only adds a
very small overhead.  To decrease complexity, this patch removes the
feature and always enables the previously feature-gated code.

Fixes: https://github.com/trussed-dev/littlefs2/issues/76
2024-09-13 11:04:11 +02:00
Robin Krahl e21c691032 Refactor attributes API
This patch refactory the API to read and write attributes so that the
buffer is always provided by the caller.  This means that the caller is
not required to always use a 1 kB buffer even if the attribute length is
much smaller.

Fixes: https://github.com/trussed-dev/littlefs2/issues/75
2024-08-16 12:01:03 +02:00
Robin Krahl 85ac8165d0 core: Use c_int where applicable
This patch applies those changes from
https://github.com/trussed-dev/littlefs2/pull/69 that affect the core
crate.
2024-08-15 08:47:07 +02:00