Skip to content

Commit

Permalink
Update versions for 0.5 (#20)
Browse files Browse the repository at this point in the history
* Update versions for 0.5

Also fixes issue when embassy-executor/nightly features are active

* Remove embassy-executor-nightly feature (#21)

* Fixup docs links

* Remove dead feature

---------

Co-authored-by: Alexander van Saase <[email protected]>
  • Loading branch information
jamesmunns and avsaase authored May 20, 2024
1 parent c5c5fb4 commit a0f90f5
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion example/firmware/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion example/firmware/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ embassy-usb = { version = "0.2.0", features = ["defmt"] }
embedded-hal-bus = { version = "0.1", features = ["async"] }
lis3dh-async = { version = "0.9.2", features = ["defmt"] }
panic-probe = { version = "0.3", features = ["print-defmt"] }
postcard-rpc = { version = "0.4", features = ["embassy-usb-0_2-server"] }
postcard-rpc = { version = "0.5", features = ["embassy-usb-0_2-server"] }
postcard = { version = "1.0.8", features = ["experimental-derive"] }
portable-atomic = { version = "1.6.0", features = ["critical-section"] }

Expand All @@ -38,6 +38,9 @@ codegen-units = 1
incremental = false

[patch.crates-io]
# NOTE: Although embassy-usb has released 0.2, we still need to use patched deps for the other various crates
# for now. See https://github.com/embassy-rs/embassy/issues/2936 for getting other min versions of these
# crates published.
embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy", rev = "763b57449fef31b2ca5205542e2c0a52e6b786c1" }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "763b57449fef31b2ca5205542e2c0a52e6b786c1" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "763b57449fef31b2ca5205542e2c0a52e6b786c1" }
Expand Down
2 changes: 1 addition & 1 deletion example/workbook-host/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/workbook-host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
path = "../workbook-icd"

[dependencies.postcard-rpc]
version = "0.4"
version = "0.5"
features = [
"use-std",
"raw-nusb",
Expand Down
2 changes: 1 addition & 1 deletion example/workbook-icd/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/workbook-icd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version = "1.0"
features = ["experimental-derive"]

[dependencies.postcard-rpc]
version = "0.4"
version = "0.5"

[patch.crates-io]
postcard-rpc = { path = "../../source/postcard-rpc" }
3 changes: 2 additions & 1 deletion source/postcard-rpc-test/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions source/postcard-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "postcard-rpc"
version = "0.4.2"
version = "0.5.0"
authors = ["James Munns <[email protected]>"]
edition = "2021"
repository = "https://github.com/jamesmunns/postcard-rpc"
Expand All @@ -19,8 +19,15 @@ documentation = "https://docs.rs/postcard-rpc/"
readme = "../../README.md"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "doc_cfg"]
features = [
"test-utils",
"use-std",
"cobs-serial",
"raw-nusb",
"embassy-usb-0_2-server",
"_docs-fix",
]

[dependencies]
cobs = { version = "0.2.3", optional = true, default-features = false }
Expand Down Expand Up @@ -78,6 +85,9 @@ optional = true
version = "0.5"
optional = true

[dev-dependencies]
postcard-rpc = { path = "../postcard-rpc", features = ["test-utils"] }

#
# Hack features (see below)
#
Expand All @@ -87,9 +97,7 @@ optional = true
features = ["std"]

[features]
default = [
# "embassy-usb-0_2-server",
]
default = []
test-utils = [
"use-std",
]
Expand Down Expand Up @@ -117,13 +125,9 @@ embassy-usb-0_2-server = [

# NOTE: This exists because `embassy-usb` indirectly relies on ssmarshal
# which doesn't work on `std` builds without the `std` feature. This causes
# `cargo doc --all-features` (and docs.rs builds) to fail. Sneakily re-active
# `cargo doc --all-features` (and docs.rs builds) to fail. Sneakily re-activate
# that feature when `--all-features` is set. This feature is considered unstable
# and should not be relied upon.
_docs-fix = [
"dep:ssmarshal",
]

[patch.crates-io]
embassy-usb = { git = "https://github.com/jamesmunns/embassy", rev = "0d0d8e14e2b0e81307ff70c5a31e300785da19f9" }
embassy-usb-driver = { git = "https://github.com/jamesmunns/embassy", rev = "0d0d8e14e2b0e81307ff70c5a31e300785da19f9" }
1 change: 0 additions & 1 deletion source/postcard-rpc/src/accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub mod raw {
}

/// The result of feeding the accumulator.
#[cfg_attr(feature = "use-defmt", derive(defmt::Format))]
pub enum FeedResult<'a, 'b> {
/// Consumed all data, still pending.
Consumed,
Expand Down
2 changes: 1 addition & 1 deletion source/postcard-rpc/src/target_server/buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl<const EO: usize, const TX: usize, const RX: usize> AllBuffers<EO, TX, RX> {
}
}

/// Buffers used by the [`UsbDevice`] of `embassy-usb`
/// Buffers used by the [`UsbDevice`][embassy_usb::UsbDevice] of `embassy-usb`
pub struct UsbDeviceBuffers {
pub config_descriptor: [u8; 256],
pub bos_descriptor: [u8; 256],
Expand Down
1 change: 1 addition & 0 deletions source/postcard-rpc/src/target_server/dispatch_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ macro_rules! define_dispatch {
/// as well as provide impls for docs. Don't rely on any of this!
#[doc(hidden)]
#[allow(dead_code)]
#[cfg(feature = "test-utils")]
pub mod fake {
use crate::target_server::SpawnContext;
#[allow(unused_imports)]
Expand Down
2 changes: 1 addition & 1 deletion source/postcard-rpc/src/target_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const DEVICE_INTERFACE_GUIDS: &[&str] = &["{AFB9A6FB-30BA-44BC-9232-806CFC875321

/// A trait that defines the postcard-rpc message dispatching behavior
///
/// This is normally generated automatically by the [`define_dispatch!()`]
/// This is normally generated automatically by the [`define_dispatch!()`][crate::define_dispatch]
/// macro.
pub trait Dispatch {
type Mutex: RawMutex;
Expand Down

0 comments on commit a0f90f5

Please sign in to comment.