Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update embassy-sync version #14

Merged
merged 6 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2021"
defmt = { version = "0.3.2", optional = true }
log = { version = "0.4.17", optional = true }
heapless = "0.8"
embassy-sync = "0.5.0"
embassy-sync = "0.6.0"

[dev-dependencies]
ekv = { path = ".", features = ["std", "log"]}
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ The on-disk format is **not stable** yet.

## Future work

- Optimize tiny write transactions: append to the last file if possible, instead of starting a new one. Currently each write transaction opens a new file, which will have to erase at least one full page, even if the transaction writes just one small key. It is recommended to batch multiple writes in a single transaction
for performance.
- Optimize tiny write transactions: append to the last file if possible, instead of starting a new one. Currently each write transaction opens a new file, which will have to erase at least one full page, even if the transaction writes just one small key. It is recommended to batch multiple writes in a single transaction for performance.
- Support access align higher than 4. Currently reads/writes are (optionally) aligned up to 4 bytes. Some flash out there can only be written in 8-byte words or higher.
- Allow writes within a transaction to be unsorted.
- Allow reads within a write transaction. They should see the the not yet committed writes in the current transaction.
Expand Down
13 changes: 7 additions & 6 deletions examples/nrf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ ekv = { path = "../../", features = [
"max-page-count-2048",
]}
embassy-futures = { version = "0.1.1" }
embassy-sync = { version = "0.5.0" }
embassy-sync = { version = "0.6.0" }
embassy-executor = { version = "0.5.0", features = ["nightly", "integrated-timers", "executor-thread", "arch-cortex-m"] }
embassy-time = { version = "0.3.0" }
embassy-nrf = { version = "0.1.0", features = ["nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] }

defmt = { version = "0.3", optional = true }
defmt-rtt = { version = "0.4", optional = true }
log = { version = "0.4", optional = true }

static_cell = "1.0"
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
Expand All @@ -54,8 +55,8 @@ opt-level = 's'
overflow-checks = false

[patch.crates-io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-nrf = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-nrf = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
12 changes: 6 additions & 6 deletions examples/rp2040/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "0.1.0"
embassy-executor = { version = "0.5.0", features = ["nightly", "defmt", "integrated-timers", "executor-thread", "arch-cortex-m"] }
embassy-time = { version = "0.3.0", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-pac", "time-driver"] }
embassy-sync = { version = "0.5.0" }
embassy-sync = { version = "0.6.0" }
embassy-futures = { version = "0.1.1" }

defmt = "0.3"
Expand All @@ -25,11 +25,11 @@ ekv = { path = "../../", features = ["crc", "align-4", "page-size-4096", "max-pa
embedded-storage = { version = "0.3" }

[patch.crates-io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "65e9f86d9e22ab2133c12cbb2613be075641ef62" }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "3c6bf3a31a951fcea31e39390ba4f0f073144933" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ekv = { path = "..", features= ["std", "log", "_test"]}
log = { version = "0.4.17" }
tokio = { version = "1.24.2", default-features = false, features = ["rt"] }
critical-section = { version = "1", features = ["std"] }
embassy-sync = "0.5.0"
embassy-sync = "0.6.0"

[[bin]]
name = "read"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2024-04-14"
channel = "nightly-2024-07-16"
components = [ "rust-src", "rustfmt", "clippy" ]
targets = [
"thumbv6m-none-eabi",
Expand Down
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
//! They can be set in two ways:
//!
//! - Via Cargo features: enable a feature like `<name>-<value>`. `name` must be in lowercase and
//! use dashes instead of underscores. For example. `max-page-count-1024`. Only a selection of values
//! is available, check `Cargo.toml` for the list.
//! use dashes instead of underscores. For example. `max-page-count-1024`. Only a selection of values
//! is available, check `Cargo.toml` for the list.
//! - Via environment variables at build time: set the variable named `EKV_<value>`. For example
//! `EKV_MAX_PAGE_COUNT=1024 cargo build`. You can also set them in the `[env]` section of `.cargo/config.toml`.
//! Any value can be set, unlike with Cargo features.
//! `EKV_MAX_PAGE_COUNT=1024 cargo build`. You can also set them in the `[env]` section of `.cargo/config.toml`.
//! Any value can be set, unlike with Cargo features.
//!
//! Environment variables take precedence over Cargo features. If two Cargo features are enabled for the same setting
//! with different values, compilation fails.
Expand Down
2 changes: 2 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use crate::page::ReadError as PageReadError;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error<E> {
/// Database is corrupted.
Corrupted,
/// Error from the underlying flash.
Flash(E),
}

Expand Down
Loading