Compare commits
36 Commits
hil-test
...
update-nig
Author | SHA1 | Date | |
---|---|---|---|
e519e00265 | |||
dd6a29adb2 | |||
74683c706b | |||
2795e1350d | |||
aed3e5674f | |||
d941882066 | |||
3f74ff7235 | |||
9cead47212 | |||
78739d4aa9 | |||
e07e790613 | |||
ca283eed0c | |||
57edf289ea | |||
3912f5d67b | |||
c9b50e46a5 | |||
ad07ea0290 | |||
573734008a | |||
f4a78e00a7 | |||
0d6094c8b1 | |||
b6fc682117 | |||
0beb84768e | |||
b98a279367 | |||
e8a3cfaed6 | |||
0cc3e18db6 | |||
6b19c0abd1 | |||
f956d19e6e | |||
ceb0d0bf08 | |||
b3879ec223 | |||
bda99e59ec | |||
25c2a9baaa | |||
1e362c750b | |||
1a51a84313 | |||
7f72dbdaf2 | |||
e8c162ac03 | |||
1aaa19748a | |||
188ee59ba6 | |||
591612db7e |
3
ci.sh
3
ci.sh
@ -218,6 +218,9 @@ cargo batch \
|
||||
rm out/tests/stm32wb55rg/wpan_mac
|
||||
rm out/tests/stm32wb55rg/wpan_ble
|
||||
|
||||
# unstable
|
||||
rm out/tests/stm32f429zi/stop
|
||||
|
||||
# unstable, I think it's running out of RAM?
|
||||
rm out/tests/stm32f207zg/eth
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![no_std]
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
|
||||
use core::slice;
|
||||
|
||||
|
@ -12,7 +12,7 @@ firmware-logs = []
|
||||
|
||||
[dependencies]
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time"}
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync"}
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync"}
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures"}
|
||||
embassy-net-driver-channel = { version = "0.2.0", path = "../embassy-net-driver-channel"}
|
||||
|
||||
|
@ -4,7 +4,6 @@ use embassy_net_driver_channel as ch;
|
||||
use embassy_net_driver_channel::driver::{HardwareAddress, LinkState};
|
||||
use embassy_time::Timer;
|
||||
|
||||
pub use crate::bus::SpiBusCyw43;
|
||||
use crate::consts::*;
|
||||
use crate::events::{Event, EventSubscriber, Events};
|
||||
use crate::fmt::Bytes;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(async_fn_in_trait, type_alias_impl_trait, concat_bytes)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
#![deny(unused_must_use)]
|
||||
|
||||
// This mod MUST go first, so that the others see its macros.
|
||||
|
@ -28,7 +28,7 @@ digest = "0.10"
|
||||
log = { version = "0.4", optional = true }
|
||||
ed25519-dalek = { version = "1.0.1", default_features = false, features = ["u32_backend"], optional = true }
|
||||
embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync" }
|
||||
embedded-storage = "0.3.0"
|
||||
embedded-storage-async = { version = "0.4.0", optional = true }
|
||||
salty = { git = "https://github.com/ycrypto/salty.git", rev = "a9f17911a5024698406b75c0fac56ab5ccf6a8c7", optional = true }
|
||||
|
@ -1,4 +1,5 @@
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
#![no_std]
|
||||
#![warn(missing_docs)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
@ -16,7 +16,7 @@ target = "thumbv7em-none-eabi"
|
||||
[dependencies]
|
||||
defmt = { version = "0.3", optional = true }
|
||||
|
||||
embassy-sync = { path = "../../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync" }
|
||||
embassy-nrf = { path = "../../embassy-nrf" }
|
||||
embassy-boot = { path = "../boot", default-features = false }
|
||||
cortex-m = { version = "0.7.6" }
|
||||
|
@ -17,7 +17,7 @@ defmt = { version = "0.3", optional = true }
|
||||
defmt-rtt = { version = "0.4", optional = true }
|
||||
log = { version = "0.4", optional = true }
|
||||
|
||||
embassy-sync = { path = "../../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync" }
|
||||
embassy-rp = { path = "../../embassy-rp", default-features = false }
|
||||
embassy-boot = { path = "../boot", default-features = false }
|
||||
embassy-time = { path = "../../embassy-time" }
|
||||
|
@ -18,7 +18,7 @@ defmt = { version = "0.3", optional = true }
|
||||
defmt-rtt = { version = "0.4", optional = true }
|
||||
log = { version = "0.4", optional = true }
|
||||
|
||||
embassy-sync = { path = "../../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync" }
|
||||
embassy-stm32 = { path = "../../embassy-stm32", default-features = false }
|
||||
embassy-boot = { path = "../boot", default-features = false }
|
||||
cortex-m = { version = "0.7.6" }
|
||||
|
@ -20,7 +20,7 @@ default = ["time"]
|
||||
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures", optional = true }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true }
|
||||
embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [
|
||||
"unproven",
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait, try_blocks))]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections, try_blocks))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
//! Utilities to use `embedded-hal` traits with Embassy.
|
||||
|
@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 0.3.1 - 2023-11-01
|
||||
|
||||
- Fix spurious "Found waker not created by the Embassy executor" error in recent nightlies.
|
||||
|
||||
## 0.3.0 - 2023-08-25
|
||||
|
||||
- Replaced Pender. Implementations now must define an extern function called `__pender`.
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "embassy-executor"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "async/await executor designed for embedded usage"
|
||||
|
@ -33,6 +33,7 @@ check_at_most_one!("arch-cortex-m", "arch-riscv32", "arch-xtensa", "arch-std", "
|
||||
mod arch;
|
||||
|
||||
#[cfg(feature = "_arch")]
|
||||
#[allow(unused_imports)] // don't warn if the module is empty.
|
||||
pub use arch::*;
|
||||
|
||||
pub mod raw;
|
||||
|
@ -3,7 +3,7 @@ use core::task::{RawWaker, RawWakerVTable, Waker};
|
||||
|
||||
use super::{wake_task, TaskHeader, TaskRef};
|
||||
|
||||
const VTABLE: RawWakerVTable = RawWakerVTable::new(clone, wake, wake, drop);
|
||||
static VTABLE: RawWakerVTable = RawWakerVTable::new(clone, wake, wake, drop);
|
||||
|
||||
unsafe fn clone(p: *const ()) -> RawWaker {
|
||||
RawWaker::new(p, &VTABLE)
|
||||
|
@ -21,7 +21,7 @@ defmt = { version = "0.3", optional = true }
|
||||
log = { version = "0.4.14", optional = true }
|
||||
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true }
|
||||
embedded-hal-async = { version = "=1.0.0-rc.1" }
|
||||
embedded-hal = { version = "0.2", features = ["unproven"] }
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![no_std]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![feature(async_fn_in_trait, impl_trait_projections)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
//! embassy-lora holds LoRa-specific functionality.
|
||||
|
||||
pub(crate) mod fmt;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![deny(clippy::pedantic)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
#![cfg_attr(not(any(test, feature = "std")), no_std)]
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
#![allow(clippy::missing_errors_doc)]
|
||||
|
@ -24,6 +24,6 @@ features = ["defmt"]
|
||||
defmt = { version = "0.3", optional = true }
|
||||
log = { version = "0.4.14", optional = true }
|
||||
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" }
|
||||
|
@ -8,7 +8,7 @@ defmt = { version = "0.3", optional = true }
|
||||
log = { version = "0.4.14", optional = true }
|
||||
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync"}
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync"}
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures"}
|
||||
embassy-net-driver-channel = { version = "0.2.0", path = "../embassy-net-driver-channel"}
|
||||
|
||||
|
@ -19,7 +19,7 @@ embedded-io-async = { version = "0.6.0" }
|
||||
embassy-net-driver-channel = { version = "0.2.0", path = "../embassy-net-driver-channel" }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
ppproto = { version = "0.1.2"}
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
|
||||
[package.metadata.embassy_docs]
|
||||
src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-ppp-v$VERSION/embassy-net-ppp/src/"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![no_std]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
||||
pub mod chip;
|
||||
|
@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 0.2.1 - 2023-10-31
|
||||
|
||||
- Re-add impl_trait_projections
|
||||
- Fix: Reset DHCP socket when the link up is detected
|
||||
|
||||
## 0.2.0 - 2023-10-18
|
||||
|
||||
- Re-export `smoltcp::wire::IpEndpoint`
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "embassy-net"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Async TCP/IP network stack for embedded systems"
|
||||
@ -53,7 +53,7 @@ smoltcp = { version = "0.10.0", default-features = false, features = [
|
||||
|
||||
embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" }
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embedded-io-async = { version = "0.6.0", optional = true }
|
||||
|
||||
managed = { version = "0.8.0", default-features = false, features = [ "map" ] }
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
#![warn(missing_docs)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
||||
|
@ -95,7 +95,7 @@ _nrf52832_anomaly_109 = []
|
||||
|
||||
[dependencies]
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-3"] }
|
||||
embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" }
|
||||
embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional=true }
|
||||
@ -110,7 +110,6 @@ defmt = { version = "0.3", optional = true }
|
||||
log = { version = "0.4.14", optional = true }
|
||||
cortex-m-rt = ">=0.6.15,<0.8"
|
||||
cortex-m = "0.7.6"
|
||||
futures = { version = "0.3.17", default-features = false }
|
||||
critical-section = "1.1"
|
||||
rand_core = "0.6.3"
|
||||
fixed = "1.10.0"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![no_std]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#![macro_use]
|
||||
|
||||
use core::future::poll_fn;
|
||||
use core::marker::PhantomData;
|
||||
use core::sync::atomic::{compiler_fence, Ordering};
|
||||
use core::task::Poll;
|
||||
@ -9,7 +10,6 @@ use core::task::Poll;
|
||||
use embassy_hal_internal::drop::OnDrop;
|
||||
use embassy_hal_internal::{into_ref, PeripheralRef};
|
||||
use fixed::types::I7F1;
|
||||
use futures::future::poll_fn;
|
||||
|
||||
use crate::chip::EASY_DMA_SIZE;
|
||||
use crate::gpio::sealed::Pin;
|
||||
|
@ -59,7 +59,7 @@ nightly = ["embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "em
|
||||
unstable-traits = ["embedded-hal-1", "embedded-hal-nb"]
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-2"] }
|
||||
@ -94,5 +94,5 @@ pio = {version= "0.2.1" }
|
||||
rp2040-boot2 = "0.3"
|
||||
|
||||
[dev-dependencies]
|
||||
embassy-executor = { version = "0.3.0", path = "../embassy-executor", features = ["nightly", "arch-std", "executor-thread"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../embassy-executor", features = ["nightly", "arch-std", "executor-thread"] }
|
||||
static_cell = "1.1"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![no_std]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
|
||||
// This mod MUST go first, so that the others see its macros.
|
||||
pub(crate) mod fmt;
|
||||
|
@ -12,7 +12,7 @@ features = ["stm32wb55rg"]
|
||||
|
||||
[dependencies]
|
||||
embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-hal-internal = { version = "0.1.0", path = "../embassy-hal-internal" }
|
||||
|
@ -1,5 +1,9 @@
|
||||
#![no_std]
|
||||
#![cfg_attr(any(feature = "ble", feature = "mac"), feature(async_fn_in_trait))]
|
||||
#![cfg_attr(
|
||||
any(feature = "ble", feature = "mac"),
|
||||
allow(stable_features, unknown_lints, async_fn_in_trait)
|
||||
)]
|
||||
#![cfg_attr(feature = "mac", feature(type_alias_impl_trait, concat_bytes))]
|
||||
|
||||
// This must go FIRST so that all the other modules see its macros.
|
||||
|
@ -1,4 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
#![deny(unused_must_use)]
|
||||
|
||||
use core::task::Context;
|
||||
|
@ -32,14 +32,14 @@ flavors = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.5", path = "../embassy-time", optional = true }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-4"] }
|
||||
embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" }
|
||||
embassy-net-driver = { version = "0.2.0", path = "../embassy-net-driver" }
|
||||
embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional = true }
|
||||
embassy-executor = { version = "0.3.0", path = "../embassy-executor", optional = true }
|
||||
embassy-executor = { version = "0.3.1", path = "../embassy-executor", optional = true }
|
||||
|
||||
embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] }
|
||||
embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.1", optional = true}
|
||||
|
@ -564,7 +564,7 @@ fn main() {
|
||||
fn enable_and_reset_with_cs(_cs: critical_section::CriticalSection) {
|
||||
#before_enable
|
||||
#[cfg(feature = "low-power")]
|
||||
crate::rcc::clock_refcount_add(_cs);
|
||||
unsafe { crate::rcc::REFCOUNT_STOP2 += 1 };
|
||||
crate::pac::RCC.#en_reg().modify(|w| w.#set_en_field(true));
|
||||
#after_enable
|
||||
#rst
|
||||
@ -573,7 +573,7 @@ fn main() {
|
||||
#before_disable
|
||||
crate::pac::RCC.#en_reg().modify(|w| w.#set_en_field(false));
|
||||
#[cfg(feature = "low-power")]
|
||||
crate::rcc::clock_refcount_sub(_cs);
|
||||
unsafe { crate::rcc::REFCOUNT_STOP2 -= 1 };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ pub(crate) fn assert_not_corrupted_read(end_address: u32) {
|
||||
feature = "stm32f439vg",
|
||||
feature = "stm32f439zg",
|
||||
))]
|
||||
if second_bank_read && unsafe { pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() } {
|
||||
if second_bank_read && pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() {
|
||||
panic!("Read corruption for stm32f42xxG and stm32f43xxG in dual bank mode when PA12 is in use for chips below revision 3, see errata 2.2.11");
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![cfg_attr(not(test), no_std)]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
|
||||
//! ## Feature flags
|
||||
#![doc = document_features::document_features!(feature_label = r#"<span class="stab portability"><code>{feature}</code></span>"#)]
|
||||
@ -226,9 +227,9 @@ pub fn init(config: Config) -> Peripherals {
|
||||
time_driver::init(cs);
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
while !crate::rcc::low_power_ready() {
|
||||
crate::rcc::clock_refcount_sub(cs);
|
||||
}
|
||||
{
|
||||
crate::rcc::REFCOUNT_STOP2 = 0
|
||||
};
|
||||
}
|
||||
|
||||
p
|
||||
|
@ -6,7 +6,6 @@ use cortex_m::peripheral::SCB;
|
||||
use embassy_executor::*;
|
||||
|
||||
use crate::interrupt;
|
||||
use crate::rcc::low_power_ready;
|
||||
use crate::time_driver::{get_driver, RtcDriver};
|
||||
|
||||
const THREAD_PENDER: usize = usize::MAX;
|
||||
@ -33,6 +32,15 @@ pub fn stop_with_rtc(rtc: &'static Rtc) {
|
||||
unsafe { EXECUTOR.as_mut().unwrap() }.stop_with_rtc(rtc)
|
||||
}
|
||||
|
||||
pub fn stop_ready(stop_mode: StopMode) -> bool {
|
||||
unsafe { EXECUTOR.as_mut().unwrap() }.stop_ready(stop_mode)
|
||||
}
|
||||
|
||||
#[non_exhaustive]
|
||||
pub enum StopMode {
|
||||
Stop2,
|
||||
}
|
||||
|
||||
/// Thread mode executor, using WFE/SEV.
|
||||
///
|
||||
/// This is the simplest and most common kind of executor. It runs on
|
||||
@ -80,12 +88,18 @@ impl Executor {
|
||||
trace!("low power: stop with rtc configured");
|
||||
}
|
||||
|
||||
fn stop_ready(&self, stop_mode: StopMode) -> bool {
|
||||
match stop_mode {
|
||||
StopMode::Stop2 => unsafe { crate::rcc::REFCOUNT_STOP2 == 0 },
|
||||
}
|
||||
}
|
||||
|
||||
fn configure_pwr(&mut self) {
|
||||
self.scb.clear_sleepdeep();
|
||||
|
||||
compiler_fence(Ordering::SeqCst);
|
||||
|
||||
if !low_power_ready() {
|
||||
if !self.stop_ready(StopMode::Stop2) {
|
||||
trace!("low power: not ready to stop");
|
||||
} else if self.time_driver.pause_time().is_err() {
|
||||
trace!("low power: failed to pause time");
|
||||
|
@ -23,8 +23,6 @@ pub use mco::*;
|
||||
#[cfg_attr(rcc_u5, path = "u5.rs")]
|
||||
#[cfg_attr(rcc_wba, path = "wba.rs")]
|
||||
mod _version;
|
||||
#[cfg(feature = "low-power")]
|
||||
use core::sync::atomic::{AtomicU32, Ordering};
|
||||
|
||||
pub use _version::*;
|
||||
|
||||
@ -183,27 +181,7 @@ pub struct Clocks {
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
static CLOCK_REFCOUNT: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
pub fn low_power_ready() -> bool {
|
||||
// trace!("clock refcount: {}", CLOCK_REFCOUNT.load(Ordering::SeqCst));
|
||||
CLOCK_REFCOUNT.load(Ordering::SeqCst) == 0
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
pub(crate) fn clock_refcount_add(_cs: critical_section::CriticalSection) {
|
||||
// We don't check for overflow because constructing more than u32 peripherals is unlikely
|
||||
let n = CLOCK_REFCOUNT.load(Ordering::Relaxed);
|
||||
CLOCK_REFCOUNT.store(n + 1, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
pub(crate) fn clock_refcount_sub(_cs: critical_section::CriticalSection) {
|
||||
let n = CLOCK_REFCOUNT.load(Ordering::Relaxed);
|
||||
assert!(n != 0);
|
||||
CLOCK_REFCOUNT.store(n - 1, Ordering::Relaxed);
|
||||
}
|
||||
pub(crate) static mut REFCOUNT_STOP2: u32 = 0;
|
||||
|
||||
/// Frozen clock frequencies
|
||||
///
|
||||
|
@ -4,8 +4,60 @@ use core::convert::From;
|
||||
#[cfg(feature = "chrono")]
|
||||
use chrono::{self, Datelike, NaiveDate, Timelike, Weekday};
|
||||
|
||||
use super::byte_to_bcd2;
|
||||
use crate::pac::rtc::Rtc;
|
||||
#[cfg(any(feature = "defmt", feature = "time"))]
|
||||
use crate::peripherals::RTC;
|
||||
#[cfg(any(feature = "defmt", feature = "time"))]
|
||||
use crate::rtc::sealed::Instance;
|
||||
|
||||
/// Represents an instant in time that can be substracted to compute a duration
|
||||
pub struct RtcInstant {
|
||||
/// 0..59
|
||||
pub second: u8,
|
||||
/// 0..256
|
||||
pub subsecond: u16,
|
||||
}
|
||||
|
||||
impl RtcInstant {
|
||||
#[allow(dead_code)]
|
||||
pub(super) fn from(second: u8, subsecond: u16) -> Result<Self, super::RtcError> {
|
||||
Ok(Self { second, subsecond })
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "defmt")]
|
||||
impl defmt::Format for RtcInstant {
|
||||
fn format(&self, fmt: defmt::Formatter) {
|
||||
defmt::write!(
|
||||
fmt,
|
||||
"{}:{}",
|
||||
self.second,
|
||||
RTC::regs().prer().read().prediv_s() - self.subsecond,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "time")]
|
||||
impl core::ops::Sub for RtcInstant {
|
||||
type Output = embassy_time::Duration;
|
||||
|
||||
fn sub(self, rhs: Self) -> Self::Output {
|
||||
use embassy_time::{Duration, TICK_HZ};
|
||||
|
||||
let second = if self.second < rhs.second {
|
||||
self.second + 60
|
||||
} else {
|
||||
self.second
|
||||
};
|
||||
|
||||
let psc = RTC::regs().prer().read().prediv_s() as u32;
|
||||
|
||||
let self_ticks = second as u32 * (psc + 1) + (psc - self.subsecond as u32);
|
||||
let other_ticks = rhs.second as u32 * (psc + 1) + (psc - rhs.subsecond as u32);
|
||||
let rtc_ticks = self_ticks - other_ticks;
|
||||
|
||||
Duration::from_ticks(((rtc_ticks * TICK_HZ as u32) / (psc + 1)) as u64)
|
||||
}
|
||||
}
|
||||
|
||||
/// Errors regarding the [`DateTime`] struct.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@ -32,19 +84,85 @@ pub enum Error {
|
||||
/// Structure containing date and time information
|
||||
pub struct DateTime {
|
||||
/// 0..4095
|
||||
pub year: u16,
|
||||
year: u16,
|
||||
/// 1..12, 1 is January
|
||||
pub month: u8,
|
||||
month: u8,
|
||||
/// 1..28,29,30,31 depending on month
|
||||
pub day: u8,
|
||||
day: u8,
|
||||
///
|
||||
pub day_of_week: DayOfWeek,
|
||||
day_of_week: DayOfWeek,
|
||||
/// 0..23
|
||||
pub hour: u8,
|
||||
hour: u8,
|
||||
/// 0..59
|
||||
pub minute: u8,
|
||||
minute: u8,
|
||||
/// 0..59
|
||||
pub second: u8,
|
||||
second: u8,
|
||||
}
|
||||
|
||||
impl DateTime {
|
||||
pub const fn year(&self) -> u16 {
|
||||
self.year
|
||||
}
|
||||
|
||||
pub const fn month(&self) -> u8 {
|
||||
self.month
|
||||
}
|
||||
|
||||
pub const fn day(&self) -> u8 {
|
||||
self.day
|
||||
}
|
||||
|
||||
pub const fn day_of_week(&self) -> DayOfWeek {
|
||||
self.day_of_week
|
||||
}
|
||||
|
||||
pub const fn hour(&self) -> u8 {
|
||||
self.hour
|
||||
}
|
||||
|
||||
pub const fn minute(&self) -> u8 {
|
||||
self.minute
|
||||
}
|
||||
|
||||
pub const fn second(&self) -> u8 {
|
||||
self.second
|
||||
}
|
||||
|
||||
pub fn from(
|
||||
year: u16,
|
||||
month: u8,
|
||||
day: u8,
|
||||
day_of_week: u8,
|
||||
hour: u8,
|
||||
minute: u8,
|
||||
second: u8,
|
||||
) -> Result<Self, Error> {
|
||||
let day_of_week = day_of_week_from_u8(day_of_week)?;
|
||||
|
||||
if year > 4095 {
|
||||
Err(Error::InvalidYear)
|
||||
} else if month < 1 || month > 12 {
|
||||
Err(Error::InvalidMonth)
|
||||
} else if day < 1 || day > 31 {
|
||||
Err(Error::InvalidDay)
|
||||
} else if hour > 23 {
|
||||
Err(Error::InvalidHour)
|
||||
} else if minute > 59 {
|
||||
Err(Error::InvalidMinute)
|
||||
} else if second > 59 {
|
||||
Err(Error::InvalidSecond)
|
||||
} else {
|
||||
Ok(Self {
|
||||
year,
|
||||
month,
|
||||
day,
|
||||
day_of_week,
|
||||
hour,
|
||||
minute,
|
||||
second,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "chrono")]
|
||||
@ -77,13 +195,13 @@ impl From<DateTime> for chrono::NaiveDateTime {
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum DayOfWeek {
|
||||
Monday = 0,
|
||||
Tuesday = 1,
|
||||
Wednesday = 2,
|
||||
Thursday = 3,
|
||||
Friday = 4,
|
||||
Saturday = 5,
|
||||
Sunday = 6,
|
||||
Monday = 1,
|
||||
Tuesday = 2,
|
||||
Wednesday = 3,
|
||||
Thursday = 4,
|
||||
Friday = 5,
|
||||
Saturday = 6,
|
||||
Sunday = 7,
|
||||
}
|
||||
|
||||
#[cfg(feature = "chrono")]
|
||||
@ -110,13 +228,13 @@ impl From<DayOfWeek> for chrono::Weekday {
|
||||
|
||||
fn day_of_week_from_u8(v: u8) -> Result<DayOfWeek, Error> {
|
||||
Ok(match v {
|
||||
0 => DayOfWeek::Monday,
|
||||
1 => DayOfWeek::Tuesday,
|
||||
2 => DayOfWeek::Wednesday,
|
||||
3 => DayOfWeek::Thursday,
|
||||
4 => DayOfWeek::Friday,
|
||||
5 => DayOfWeek::Saturday,
|
||||
6 => DayOfWeek::Sunday,
|
||||
1 => DayOfWeek::Monday,
|
||||
2 => DayOfWeek::Tuesday,
|
||||
3 => DayOfWeek::Wednesday,
|
||||
4 => DayOfWeek::Thursday,
|
||||
5 => DayOfWeek::Friday,
|
||||
6 => DayOfWeek::Saturday,
|
||||
7 => DayOfWeek::Sunday,
|
||||
x => return Err(Error::InvalidDayOfWeek(x)),
|
||||
})
|
||||
}
|
||||
@ -142,58 +260,3 @@ pub(super) fn validate_datetime(dt: &DateTime) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn write_date_time(rtc: &Rtc, t: DateTime) {
|
||||
let (ht, hu) = byte_to_bcd2(t.hour as u8);
|
||||
let (mnt, mnu) = byte_to_bcd2(t.minute as u8);
|
||||
let (st, su) = byte_to_bcd2(t.second as u8);
|
||||
|
||||
let (dt, du) = byte_to_bcd2(t.day as u8);
|
||||
let (mt, mu) = byte_to_bcd2(t.month as u8);
|
||||
let yr = t.year as u16;
|
||||
let yr_offset = (yr - 1970_u16) as u8;
|
||||
let (yt, yu) = byte_to_bcd2(yr_offset);
|
||||
|
||||
use crate::pac::rtc::vals::Ampm;
|
||||
|
||||
rtc.tr().write(|w| {
|
||||
w.set_ht(ht);
|
||||
w.set_hu(hu);
|
||||
w.set_mnt(mnt);
|
||||
w.set_mnu(mnu);
|
||||
w.set_st(st);
|
||||
w.set_su(su);
|
||||
w.set_pm(Ampm::AM);
|
||||
});
|
||||
|
||||
rtc.dr().write(|w| {
|
||||
w.set_dt(dt);
|
||||
w.set_du(du);
|
||||
w.set_mt(mt > 0);
|
||||
w.set_mu(mu);
|
||||
w.set_yt(yt);
|
||||
w.set_yu(yu);
|
||||
w.set_wdu(day_of_week_to_u8(t.day_of_week));
|
||||
});
|
||||
}
|
||||
|
||||
pub(super) fn datetime(
|
||||
year: u16,
|
||||
month: u8,
|
||||
day: u8,
|
||||
day_of_week: u8,
|
||||
hour: u8,
|
||||
minute: u8,
|
||||
second: u8,
|
||||
) -> Result<DateTime, Error> {
|
||||
let day_of_week = day_of_week_from_u8(day_of_week)?;
|
||||
Ok(DateTime {
|
||||
year,
|
||||
month,
|
||||
day,
|
||||
day_of_week,
|
||||
hour,
|
||||
minute,
|
||||
second,
|
||||
})
|
||||
}
|
||||
|
@ -9,7 +9,8 @@ use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
#[cfg(feature = "low-power")]
|
||||
use embassy_sync::blocking_mutex::Mutex;
|
||||
|
||||
pub use self::datetime::{DateTime, DayOfWeek, Error as DateTimeError};
|
||||
pub use self::datetime::{DateTime, DayOfWeek, Error as DateTimeError, RtcInstant};
|
||||
use crate::rtc::datetime::day_of_week_to_u8;
|
||||
use crate::time::Hertz;
|
||||
|
||||
/// refer to AN4759 to compare features of RTC2 and RTC3
|
||||
@ -39,48 +40,6 @@ pub enum RtcError {
|
||||
NotRunning,
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
/// Represents an instant in time that can be substracted to compute a duration
|
||||
struct RtcInstant {
|
||||
second: u8,
|
||||
subsecond: u16,
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "low-power", feature = "defmt"))]
|
||||
impl defmt::Format for RtcInstant {
|
||||
fn format(&self, fmt: defmt::Formatter) {
|
||||
defmt::write!(
|
||||
fmt,
|
||||
"{}:{}",
|
||||
self.second,
|
||||
RTC::regs().prer().read().prediv_s() - self.subsecond,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
impl core::ops::Sub for RtcInstant {
|
||||
type Output = embassy_time::Duration;
|
||||
|
||||
fn sub(self, rhs: Self) -> Self::Output {
|
||||
use embassy_time::{Duration, TICK_HZ};
|
||||
|
||||
let second = if self.second < rhs.second {
|
||||
self.second + 60
|
||||
} else {
|
||||
self.second
|
||||
};
|
||||
|
||||
let psc = RTC::regs().prer().read().prediv_s() as u32;
|
||||
|
||||
let self_ticks = second as u32 * (psc + 1) + (psc - self.subsecond as u32);
|
||||
let other_ticks = rhs.second as u32 * (psc + 1) + (psc - rhs.subsecond as u32);
|
||||
let rtc_ticks = self_ticks - other_ticks;
|
||||
|
||||
Duration::from_ticks(((rtc_ticks * TICK_HZ as u32) / (psc + 1)) as u64)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct RtcTimeProvider {
|
||||
_private: (),
|
||||
}
|
||||
@ -113,7 +72,7 @@ impl RtcTimeProvider {
|
||||
let month = bcd2_to_byte((dr.mt() as u8, dr.mu()));
|
||||
let year = bcd2_to_byte((dr.yt(), dr.yu())) as u16 + 1970_u16;
|
||||
|
||||
return self::datetime::datetime(year, month, day, weekday, hour, minute, second)
|
||||
return DateTime::from(year, month, day, weekday, hour, minute, second)
|
||||
.map_err(RtcError::InvalidDateTime);
|
||||
}
|
||||
}
|
||||
@ -134,7 +93,7 @@ impl RtcTimeProvider {
|
||||
let month = bcd2_to_byte((dr.mt() as u8, dr.mu()));
|
||||
let year = bcd2_to_byte((dr.yt(), dr.yu())) as u16 + 1970_u16;
|
||||
|
||||
self::datetime::datetime(year, month, day, weekday, hour, minute, second).map_err(RtcError::InvalidDateTime)
|
||||
DateTime::from(year, month, day, weekday, hour, minute, second).map_err(RtcError::InvalidDateTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -187,7 +146,9 @@ impl Rtc {
|
||||
critical_section::with(|cs| {
|
||||
<RTC as crate::rcc::sealed::RccPeripheral>::enable_and_reset_with_cs(cs);
|
||||
#[cfg(feature = "low-power")]
|
||||
crate::rcc::clock_refcount_sub(cs);
|
||||
unsafe {
|
||||
crate::rcc::REFCOUNT_STOP2 -= 1
|
||||
};
|
||||
});
|
||||
|
||||
let mut this = Self {
|
||||
@ -223,14 +184,46 @@ impl Rtc {
|
||||
/// Will return `RtcError::InvalidDateTime` if the datetime is not a valid range.
|
||||
pub fn set_datetime(&mut self, t: DateTime) -> Result<(), RtcError> {
|
||||
self::datetime::validate_datetime(&t).map_err(RtcError::InvalidDateTime)?;
|
||||
self.write(true, |rtc| self::datetime::write_date_time(rtc, t));
|
||||
self.write(true, |rtc| {
|
||||
let (ht, hu) = byte_to_bcd2(t.hour() as u8);
|
||||
let (mnt, mnu) = byte_to_bcd2(t.minute() as u8);
|
||||
let (st, su) = byte_to_bcd2(t.second() as u8);
|
||||
|
||||
let (dt, du) = byte_to_bcd2(t.day() as u8);
|
||||
let (mt, mu) = byte_to_bcd2(t.month() as u8);
|
||||
let yr = t.year() as u16;
|
||||
let yr_offset = (yr - 1970_u16) as u8;
|
||||
let (yt, yu) = byte_to_bcd2(yr_offset);
|
||||
|
||||
use crate::pac::rtc::vals::Ampm;
|
||||
|
||||
rtc.tr().write(|w| {
|
||||
w.set_ht(ht);
|
||||
w.set_hu(hu);
|
||||
w.set_mnt(mnt);
|
||||
w.set_mnu(mnu);
|
||||
w.set_st(st);
|
||||
w.set_su(su);
|
||||
w.set_pm(Ampm::AM);
|
||||
});
|
||||
|
||||
rtc.dr().write(|w| {
|
||||
w.set_dt(dt);
|
||||
w.set_du(du);
|
||||
w.set_mt(mt > 0);
|
||||
w.set_mu(mu);
|
||||
w.set_yt(yt);
|
||||
w.set_yu(yu);
|
||||
w.set_wdu(day_of_week_to_u8(t.day_of_week()));
|
||||
});
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
#[cfg(not(rtc_v2f2))]
|
||||
/// Return the current instant.
|
||||
fn instant(&self) -> RtcInstant {
|
||||
pub fn instant(&self) -> Result<RtcInstant, RtcError> {
|
||||
let r = RTC::regs();
|
||||
let tr = r.tr().read();
|
||||
let subsecond = r.ssr().read().ss();
|
||||
@ -239,7 +232,7 @@ impl Rtc {
|
||||
// Unlock the registers
|
||||
r.dr().read();
|
||||
|
||||
RtcInstant { second, subsecond }
|
||||
RtcInstant::from(second, subsecond.try_into().unwrap())
|
||||
}
|
||||
|
||||
/// Return the current datetime.
|
||||
|
@ -95,15 +95,16 @@ impl super::Rtc {
|
||||
regs.cr().modify(|w| w.set_wutie(true));
|
||||
});
|
||||
|
||||
let instant = self.instant().unwrap();
|
||||
trace!(
|
||||
"rtc: start wakeup alarm for {} ms (psc: {}, ticks: {}) at {}",
|
||||
Duration::from_ticks(rtc_ticks as u64 * TICK_HZ * prescaler as u64 / rtc_hz).as_millis(),
|
||||
prescaler as u32,
|
||||
rtc_ticks,
|
||||
self.instant(),
|
||||
instant,
|
||||
);
|
||||
|
||||
assert!(self.stop_time.borrow(cs).replace(Some(self.instant())).is_none())
|
||||
assert!(self.stop_time.borrow(cs).replace(Some(instant)).is_none())
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
@ -112,8 +113,9 @@ impl super::Rtc {
|
||||
pub(crate) fn stop_wakeup_alarm(&self, cs: critical_section::CriticalSection) -> Option<embassy_time::Duration> {
|
||||
use crate::interrupt::typelevel::Interrupt;
|
||||
|
||||
let instant = self.instant().unwrap();
|
||||
if RTC::regs().cr().read().wute() {
|
||||
trace!("rtc: stop wakeup alarm at {}", self.instant());
|
||||
trace!("rtc: stop wakeup alarm at {}", instant);
|
||||
|
||||
self.write(false, |regs| {
|
||||
regs.cr().modify(|w| w.set_wutie(false));
|
||||
@ -128,10 +130,7 @@ impl super::Rtc {
|
||||
});
|
||||
}
|
||||
|
||||
self.stop_time
|
||||
.borrow(cs)
|
||||
.take()
|
||||
.map(|stop_time| self.instant() - stop_time)
|
||||
self.stop_time.borrow(cs).take().map(|stop_time| instant - stop_time)
|
||||
}
|
||||
|
||||
#[cfg(feature = "low-power")]
|
||||
|
@ -116,28 +116,28 @@ pub struct BufferedUartRx<'d, T: BasicInstance> {
|
||||
|
||||
impl<'d, T: BasicInstance> SetConfig for BufferedUart<'d, T> {
|
||||
type Config = Config;
|
||||
type ConfigError = ();
|
||||
type ConfigError = ConfigError;
|
||||
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {
|
||||
self.set_config(config).map_err(|_| ())
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError> {
|
||||
self.set_config(config)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'d, T: BasicInstance> SetConfig for BufferedUartRx<'d, T> {
|
||||
type Config = Config;
|
||||
type ConfigError = ();
|
||||
type ConfigError = ConfigError;
|
||||
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {
|
||||
self.set_config(config).map_err(|_| ())
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError> {
|
||||
self.set_config(config)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'d, T: BasicInstance> SetConfig for BufferedUartTx<'d, T> {
|
||||
type Config = Config;
|
||||
type ConfigError = ();
|
||||
type ConfigError = ConfigError;
|
||||
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {
|
||||
self.set_config(config).map_err(|_| ())
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError> {
|
||||
self.set_config(config)
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,9 +233,6 @@ impl<'d, T: BasicInstance> BufferedUart<'d, T> {
|
||||
configure(r, &config, T::frequency(), T::KIND, true, true)?;
|
||||
|
||||
r.cr1().modify(|w| {
|
||||
#[cfg(lpuart_v2)]
|
||||
w.set_fifoen(true);
|
||||
|
||||
w.set_rxneie(true);
|
||||
w.set_idleie(true);
|
||||
});
|
||||
@ -254,7 +251,14 @@ impl<'d, T: BasicInstance> BufferedUart<'d, T> {
|
||||
}
|
||||
|
||||
pub fn set_config(&mut self, config: &Config) -> Result<(), ConfigError> {
|
||||
reconfigure::<T>(config)
|
||||
reconfigure::<T>(config)?;
|
||||
|
||||
T::regs().cr1().modify(|w| {
|
||||
w.set_rxneie(true);
|
||||
w.set_idleie(true);
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@ -334,7 +338,14 @@ impl<'d, T: BasicInstance> BufferedUartRx<'d, T> {
|
||||
}
|
||||
|
||||
pub fn set_config(&mut self, config: &Config) -> Result<(), ConfigError> {
|
||||
reconfigure::<T>(config)
|
||||
reconfigure::<T>(config)?;
|
||||
|
||||
T::regs().cr1().modify(|w| {
|
||||
w.set_rxneie(true);
|
||||
w.set_idleie(true);
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,7 +419,14 @@ impl<'d, T: BasicInstance> BufferedUartTx<'d, T> {
|
||||
}
|
||||
|
||||
pub fn set_config(&mut self, config: &Config) -> Result<(), ConfigError> {
|
||||
reconfigure::<T>(config)
|
||||
reconfigure::<T>(config)?;
|
||||
|
||||
T::regs().cr1().modify(|w| {
|
||||
w.set_rxneie(true);
|
||||
w.set_idleie(true);
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,7 @@ pub enum StopBits {
|
||||
pub enum ConfigError {
|
||||
BaudrateTooLow,
|
||||
BaudrateTooHigh,
|
||||
RxOrTxNotEnabled,
|
||||
}
|
||||
|
||||
#[non_exhaustive]
|
||||
@ -181,11 +182,11 @@ pub struct Uart<'d, T: BasicInstance, TxDma = NoDma, RxDma = NoDma> {
|
||||
|
||||
impl<'d, T: BasicInstance, TxDma, RxDma> SetConfig for Uart<'d, T, TxDma, RxDma> {
|
||||
type Config = Config;
|
||||
type ConfigError = ();
|
||||
type ConfigError = ConfigError;
|
||||
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {
|
||||
self.tx.set_config(config).map_err(|_| ())?;
|
||||
self.rx.set_config(config).map_err(|_| ())
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError> {
|
||||
self.tx.set_config(config)?;
|
||||
self.rx.set_config(config)
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,10 +197,10 @@ pub struct UartTx<'d, T: BasicInstance, TxDma = NoDma> {
|
||||
|
||||
impl<'d, T: BasicInstance, TxDma> SetConfig for UartTx<'d, T, TxDma> {
|
||||
type Config = Config;
|
||||
type ConfigError = ();
|
||||
type ConfigError = ConfigError;
|
||||
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {
|
||||
self.set_config(config).map_err(|_| ())
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError> {
|
||||
self.set_config(config)
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,10 +214,10 @@ pub struct UartRx<'d, T: BasicInstance, RxDma = NoDma> {
|
||||
|
||||
impl<'d, T: BasicInstance, RxDma> SetConfig for UartRx<'d, T, RxDma> {
|
||||
type Config = Config;
|
||||
type ConfigError = ();
|
||||
type ConfigError = ConfigError;
|
||||
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {
|
||||
self.set_config(config).map_err(|_| ())
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError> {
|
||||
self.set_config(config)
|
||||
}
|
||||
}
|
||||
|
||||
@ -866,7 +867,7 @@ fn configure(
|
||||
enable_tx: bool,
|
||||
) -> Result<(), ConfigError> {
|
||||
if !enable_rx && !enable_tx {
|
||||
panic!("USART: At least one of RX or TX should be enabled");
|
||||
return Err(ConfigError::RxOrTxNotEnabled);
|
||||
}
|
||||
|
||||
#[cfg(not(usart_v4))]
|
||||
@ -909,6 +910,11 @@ fn configure(
|
||||
brr + rounding
|
||||
}
|
||||
|
||||
// UART must be disabled during configuration.
|
||||
r.cr1().modify(|w| {
|
||||
w.set_ue(false);
|
||||
});
|
||||
|
||||
#[cfg(not(usart_v1))]
|
||||
let mut over8 = false;
|
||||
let mut found_brr = None;
|
||||
@ -968,6 +974,12 @@ fn configure(
|
||||
#[cfg(any(usart_v3, usart_v4))]
|
||||
w.set_swap(config.swap_rx_tx);
|
||||
});
|
||||
|
||||
#[cfg(not(usart_v1))]
|
||||
r.cr3().modify(|w| {
|
||||
w.set_onebit(config.assume_noise_free);
|
||||
});
|
||||
|
||||
r.cr1().write(|w| {
|
||||
// enable uart
|
||||
w.set_ue(true);
|
||||
@ -976,6 +988,7 @@ fn configure(
|
||||
// enable receiver
|
||||
w.set_re(enable_rx);
|
||||
// configure word size
|
||||
// if using odd or even parity it must be configured to 9bits
|
||||
w.set_m0(if config.parity != Parity::ParityNone {
|
||||
vals::M0::BIT9
|
||||
} else {
|
||||
@ -994,11 +1007,6 @@ fn configure(
|
||||
w.set_fifoen(true);
|
||||
});
|
||||
|
||||
#[cfg(not(usart_v1))]
|
||||
r.cr3().modify(|w| {
|
||||
w.set_onebit(config.assume_noise_free);
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,10 @@ pub struct RingBufferedUartRx<'d, T: BasicInstance, RxDma: super::RxDma<T>> {
|
||||
|
||||
impl<'d, T: BasicInstance, RxDma: super::RxDma<T>> SetConfig for RingBufferedUartRx<'d, T, RxDma> {
|
||||
type Config = Config;
|
||||
type ConfigError = ();
|
||||
type ConfigError = ConfigError;
|
||||
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> {
|
||||
self.set_config(config).map_err(|_| ())
|
||||
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError> {
|
||||
self.set_config(config)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,14 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 0.4.0 - 2023-10-31
|
||||
|
||||
- Re-add impl_trait_projections
|
||||
- switch to `embedded-io 0.6`
|
||||
|
||||
## 0.3.0 - 2023-09-14
|
||||
|
||||
- switch to embedded-io 0.5
|
||||
- switch to `embedded-io 0.5`
|
||||
- add api for polling channels with context
|
||||
- standardise fn names on channels
|
||||
- add zero-copy channel
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "embassy-sync"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
edition = "2021"
|
||||
description = "no-std, no-alloc synchronization primitives with async support"
|
||||
repository = "https://github.com/embassy-rs/embassy"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![cfg_attr(not(any(feature = "std", feature = "wasm")), no_std)]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait, impl_trait_projections))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
#![allow(clippy::new_without_default)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![warn(missing_docs)]
|
||||
|
@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 0.1.6 - ???
|
||||
|
||||
- Added tick rates in multiples of 10 kHz
|
||||
|
||||
## 0.1.5 - 2023-10-16
|
||||
|
||||
- Added `links` key to Cargo.toml, to prevent multiple copies of this crate in the same binary.
|
||||
|
@ -59,6 +59,9 @@ generic-queue-32 = ["generic-queue"]
|
||||
generic-queue-64 = ["generic-queue"]
|
||||
generic-queue-128 = ["generic-queue"]
|
||||
|
||||
# Create a `MockDriver` that can be manually advanced for testing purposes.
|
||||
mock-driver = ["tick-hz-1_000_000"]
|
||||
|
||||
# Set the `embassy_time` tick rate.
|
||||
#
|
||||
# At most 1 `tick-*` feature can be enabled. If none is enabled, a default of 1MHz is used.
|
||||
@ -126,6 +129,25 @@ tick-hz-65_536_000 = []
|
||||
tick-hz-131_072_000 = []
|
||||
tick-hz-262_144_000 = []
|
||||
tick-hz-524_288_000 = []
|
||||
tick-hz-20_000 = []
|
||||
tick-hz-40_000 = []
|
||||
tick-hz-80_000 = []
|
||||
tick-hz-160_000 = []
|
||||
tick-hz-320_000 = []
|
||||
tick-hz-640_000 = []
|
||||
tick-hz-1_280_000 = []
|
||||
tick-hz-2_560_000 = []
|
||||
tick-hz-5_120_000 = []
|
||||
tick-hz-10_240_000 = []
|
||||
tick-hz-20_480_000 = []
|
||||
tick-hz-40_960_000 = []
|
||||
tick-hz-81_920_000 = []
|
||||
tick-hz-163_840_000 = []
|
||||
tick-hz-327_680_000 = []
|
||||
tick-hz-655_360_000 = []
|
||||
tick-hz-1_310_720_000 = []
|
||||
tick-hz-2_621_440_000 = []
|
||||
tick-hz-5_242_880_000 = []
|
||||
tick-hz-2_000_000 = []
|
||||
tick-hz-3_000_000 = []
|
||||
tick-hz-4_000_000 = []
|
||||
@ -236,4 +258,4 @@ wasm-timer = { version = "0.2.5", optional = true }
|
||||
[dev-dependencies]
|
||||
serial_test = "0.9"
|
||||
critical-section = { version = "1.1", features = ["std"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../embassy-executor", features = ["nightly"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../embassy-executor", features = ["nightly"] }
|
||||
|
@ -13,6 +13,8 @@ for i in range(1, 25):
|
||||
ticks.append(2**i)
|
||||
for i in range(1, 20):
|
||||
ticks.append(2**i * 1000)
|
||||
for i in range(1, 20):
|
||||
ticks.append(2**i * 10000)
|
||||
for i in range(1, 10):
|
||||
ticks.append(2**i * 1000000)
|
||||
ticks.append(2**i * 9 // 8 * 1000000)
|
||||
|
68
embassy-time/src/driver_mock.rs
Normal file
68
embassy-time/src/driver_mock.rs
Normal file
@ -0,0 +1,68 @@
|
||||
use core::cell::Cell;
|
||||
|
||||
use critical_section::Mutex as CsMutex;
|
||||
|
||||
use crate::driver::{AlarmHandle, Driver};
|
||||
use crate::{Duration, Instant};
|
||||
|
||||
/// A mock driver that can be manually advanced.
|
||||
/// This is useful for testing code that works with [`Instant`] and [`Duration`].
|
||||
///
|
||||
/// This driver cannot currently be used to test runtime functionality, such as
|
||||
/// timers, delays, etc.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```ignore
|
||||
/// fn has_a_second_passed(reference: Instant) -> bool {
|
||||
/// Instant::now().duration_since(reference) >= Duration::from_secs(1)
|
||||
/// }
|
||||
///
|
||||
/// fn test_second_passed() {
|
||||
/// let driver = embassy_time::MockDriver::get();
|
||||
/// let reference = Instant::now();
|
||||
/// assert_eq!(false, has_a_second_passed(reference));
|
||||
/// driver.advance(Duration::from_secs(1));
|
||||
/// assert_eq!(true, has_a_second_passed(reference));
|
||||
/// }
|
||||
/// ```
|
||||
pub struct MockDriver {
|
||||
now: CsMutex<Cell<Instant>>,
|
||||
}
|
||||
|
||||
crate::time_driver_impl!(static DRIVER: MockDriver = MockDriver {
|
||||
now: CsMutex::new(Cell::new(Instant::from_ticks(0))),
|
||||
});
|
||||
|
||||
impl MockDriver {
|
||||
/// Gets a reference to the global mock driver.
|
||||
pub fn get() -> &'static MockDriver {
|
||||
&DRIVER
|
||||
}
|
||||
|
||||
/// Advances the time by the specified [`Duration`].
|
||||
pub fn advance(&self, duration: Duration) {
|
||||
critical_section::with(|cs| {
|
||||
let now = self.now.borrow(cs).get().as_ticks();
|
||||
self.now.borrow(cs).set(Instant::from_ticks(now + duration.as_ticks()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl Driver for MockDriver {
|
||||
fn now(&self) -> u64 {
|
||||
critical_section::with(|cs| self.now.borrow(cs).get().as_micros() as u64)
|
||||
}
|
||||
|
||||
unsafe fn allocate_alarm(&self) -> Option<AlarmHandle> {
|
||||
unimplemented!("MockDriver does not support runtime features that require an executor");
|
||||
}
|
||||
|
||||
fn set_alarm_callback(&self, _alarm: AlarmHandle, _callback: fn(*mut ()), _ctx: *mut ()) {
|
||||
unimplemented!("MockDriver does not support runtime features that require an executor");
|
||||
}
|
||||
|
||||
fn set_alarm(&self, _alarm: AlarmHandle, _timestamp: u64) -> bool {
|
||||
unimplemented!("MockDriver does not support runtime features that require an executor");
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#![cfg_attr(not(any(feature = "std", feature = "wasm", test)), no_std)]
|
||||
#![cfg_attr(feature = "nightly", feature(async_fn_in_trait))]
|
||||
#![cfg_attr(feature = "nightly", allow(stable_features, unknown_lints, async_fn_in_trait))]
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![allow(clippy::new_without_default)]
|
||||
#![warn(missing_docs)]
|
||||
@ -15,6 +16,12 @@ pub mod queue;
|
||||
mod tick;
|
||||
mod timer;
|
||||
|
||||
#[cfg(feature = "mock-driver")]
|
||||
mod driver_mock;
|
||||
|
||||
#[cfg(feature = "mock-driver")]
|
||||
pub use driver_mock::MockDriver;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
mod driver_std;
|
||||
#[cfg(feature = "wasm")]
|
||||
|
@ -106,6 +106,44 @@ pub const TICK_HZ: u64 = 131_072_000;
|
||||
pub const TICK_HZ: u64 = 262_144_000;
|
||||
#[cfg(feature = "tick-hz-524_288_000")]
|
||||
pub const TICK_HZ: u64 = 524_288_000;
|
||||
#[cfg(feature = "tick-hz-20_000")]
|
||||
pub const TICK_HZ: u64 = 20_000;
|
||||
#[cfg(feature = "tick-hz-40_000")]
|
||||
pub const TICK_HZ: u64 = 40_000;
|
||||
#[cfg(feature = "tick-hz-80_000")]
|
||||
pub const TICK_HZ: u64 = 80_000;
|
||||
#[cfg(feature = "tick-hz-160_000")]
|
||||
pub const TICK_HZ: u64 = 160_000;
|
||||
#[cfg(feature = "tick-hz-320_000")]
|
||||
pub const TICK_HZ: u64 = 320_000;
|
||||
#[cfg(feature = "tick-hz-640_000")]
|
||||
pub const TICK_HZ: u64 = 640_000;
|
||||
#[cfg(feature = "tick-hz-1_280_000")]
|
||||
pub const TICK_HZ: u64 = 1_280_000;
|
||||
#[cfg(feature = "tick-hz-2_560_000")]
|
||||
pub const TICK_HZ: u64 = 2_560_000;
|
||||
#[cfg(feature = "tick-hz-5_120_000")]
|
||||
pub const TICK_HZ: u64 = 5_120_000;
|
||||
#[cfg(feature = "tick-hz-10_240_000")]
|
||||
pub const TICK_HZ: u64 = 10_240_000;
|
||||
#[cfg(feature = "tick-hz-20_480_000")]
|
||||
pub const TICK_HZ: u64 = 20_480_000;
|
||||
#[cfg(feature = "tick-hz-40_960_000")]
|
||||
pub const TICK_HZ: u64 = 40_960_000;
|
||||
#[cfg(feature = "tick-hz-81_920_000")]
|
||||
pub const TICK_HZ: u64 = 81_920_000;
|
||||
#[cfg(feature = "tick-hz-163_840_000")]
|
||||
pub const TICK_HZ: u64 = 163_840_000;
|
||||
#[cfg(feature = "tick-hz-327_680_000")]
|
||||
pub const TICK_HZ: u64 = 327_680_000;
|
||||
#[cfg(feature = "tick-hz-655_360_000")]
|
||||
pub const TICK_HZ: u64 = 655_360_000;
|
||||
#[cfg(feature = "tick-hz-1_310_720_000")]
|
||||
pub const TICK_HZ: u64 = 1_310_720_000;
|
||||
#[cfg(feature = "tick-hz-2_621_440_000")]
|
||||
pub const TICK_HZ: u64 = 2_621_440_000;
|
||||
#[cfg(feature = "tick-hz-5_242_880_000")]
|
||||
pub const TICK_HZ: u64 = 5_242_880_000;
|
||||
#[cfg(feature = "tick-hz-2_000_000")]
|
||||
pub const TICK_HZ: u64 = 2_000_000;
|
||||
#[cfg(feature = "tick-hz-3_000_000")]
|
||||
@ -334,6 +372,25 @@ pub const TICK_HZ: u64 = 980_000_000;
|
||||
feature = "tick-hz-131_072_000",
|
||||
feature = "tick-hz-262_144_000",
|
||||
feature = "tick-hz-524_288_000",
|
||||
feature = "tick-hz-20_000",
|
||||
feature = "tick-hz-40_000",
|
||||
feature = "tick-hz-80_000",
|
||||
feature = "tick-hz-160_000",
|
||||
feature = "tick-hz-320_000",
|
||||
feature = "tick-hz-640_000",
|
||||
feature = "tick-hz-1_280_000",
|
||||
feature = "tick-hz-2_560_000",
|
||||
feature = "tick-hz-5_120_000",
|
||||
feature = "tick-hz-10_240_000",
|
||||
feature = "tick-hz-20_480_000",
|
||||
feature = "tick-hz-40_960_000",
|
||||
feature = "tick-hz-81_920_000",
|
||||
feature = "tick-hz-163_840_000",
|
||||
feature = "tick-hz-327_680_000",
|
||||
feature = "tick-hz-655_360_000",
|
||||
feature = "tick-hz-1_310_720_000",
|
||||
feature = "tick-hz-2_621_440_000",
|
||||
feature = "tick-hz-5_242_880_000",
|
||||
feature = "tick-hz-2_000_000",
|
||||
feature = "tick-hz-3_000_000",
|
||||
feature = "tick-hz-4_000_000",
|
||||
|
@ -1,5 +1,6 @@
|
||||
#![no_std]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
|
@ -10,7 +10,7 @@ target = "thumbv7em-none-eabi"
|
||||
|
||||
[dependencies]
|
||||
embassy-usb = { version = "0.1.0", path = "../embassy-usb" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
futures = { version = "0.3", default-features = false }
|
||||
static_cell = "1"
|
||||
|
@ -41,7 +41,7 @@ max-handler-count-8 = []
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-usb-driver = { version = "0.1.0", path = "../embassy-usb-driver" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../embassy-sync" }
|
||||
embassy-net-driver-channel = { version = "0.2.0", path = "../embassy-net-driver-channel" }
|
||||
|
||||
defmt = { version = "0.3", optional = true }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly"] }
|
||||
embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly"] }
|
||||
embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", "unstable-traits", "nightly"] }
|
||||
embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] }
|
||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] }
|
||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] }
|
||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] }
|
||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] }
|
||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] }
|
||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] }
|
||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] }
|
||||
|
@ -12,7 +12,7 @@ defmt-rtt = { version = "0.4", optional = true }
|
||||
embassy-nrf = { path = "../../../../embassy-nrf", features = ["nightly"] }
|
||||
embassy-boot-nrf = { path = "../../../../embassy-boot/nrf" }
|
||||
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
|
||||
embassy-sync = { path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
cortex-m-rt = { version = "0.7" }
|
||||
cfg-if = "1.0.0"
|
||||
|
||||
|
@ -11,7 +11,7 @@ defmt-rtt = { version = "0.4", optional = true }
|
||||
|
||||
embassy-rp = { path = "../../../../embassy-rp", features = ["nightly"] }
|
||||
embassy-boot-rp = { path = "../../../../embassy-boot/rp" }
|
||||
embassy-sync = { path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
embassy-time = { path = "../../../../embassy-time", features = ["nightly"] }
|
||||
|
||||
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
|
||||
|
@ -12,7 +12,7 @@ defmt-rtt = { version = "0.4", optional = true }
|
||||
embassy-stm32 = { path = "../../../../embassy-stm32", features = ["nightly"] }
|
||||
embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32" }
|
||||
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
|
||||
embassy-sync = { path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.4.0", path = "../../../../embassy-sync" }
|
||||
cortex-m-rt = { version = "0.7" }
|
||||
embedded-storage = "0.3.0"
|
||||
embedded-storage-async = "0.4.0"
|
||||
|
@ -16,8 +16,8 @@ log = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "rtos-trace", "rtos-trace-interrupt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "rtos-trace", "rtos-trace-interrupt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time" }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] }
|
||||
|
||||
|
@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
rtic = { version = "2", features = ["thumbv7-backend"] }
|
||||
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "generic-queue"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nightly", "unstable-traits", "defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
|
||||
|
||||
|
@ -29,8 +29,8 @@ nightly = [
|
||||
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"], optional = true }
|
||||
|
@ -6,10 +6,10 @@ license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = [
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = [
|
||||
"defmt",
|
||||
] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread",
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread",
|
||||
"nightly",
|
||||
"defmt",
|
||||
"integrated-timers",
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] }
|
||||
embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
169
examples/rp/src/bin/pio_stepper.rs
Normal file
169
examples/rp/src/bin/pio_stepper.rs
Normal file
@ -0,0 +1,169 @@
|
||||
//! This example shows how to use the PIO module in the RP2040 to implement a stepper motor driver
|
||||
//! for a 5-wire stepper such as the 28BYJ-48. You can halt an ongoing rotation by dropping the future.
|
||||
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
use core::mem::{self, MaybeUninit};
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Irq, Pio, PioPin, StateMachine};
|
||||
use embassy_time::{with_timeout, Duration, Timer};
|
||||
use fixed::traits::ToFixed;
|
||||
use fixed::types::extra::U8;
|
||||
use fixed::FixedU32;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
||||
pub struct PioStepper<'d, T: Instance, const SM: usize> {
|
||||
irq: Irq<'d, T, SM>,
|
||||
sm: StateMachine<'d, T, SM>,
|
||||
}
|
||||
|
||||
impl<'d, T: Instance, const SM: usize> PioStepper<'d, T, SM> {
|
||||
pub fn new(
|
||||
pio: &mut Common<'d, T>,
|
||||
mut sm: StateMachine<'d, T, SM>,
|
||||
irq: Irq<'d, T, SM>,
|
||||
pin0: impl PioPin,
|
||||
pin1: impl PioPin,
|
||||
pin2: impl PioPin,
|
||||
pin3: impl PioPin,
|
||||
) -> Self {
|
||||
let prg = pio_proc::pio_asm!(
|
||||
"pull block",
|
||||
"mov x, osr",
|
||||
"pull block",
|
||||
"mov y, osr",
|
||||
"jmp !x end",
|
||||
"loop:",
|
||||
"jmp !osre step",
|
||||
"mov osr, y",
|
||||
"step:",
|
||||
"out pins, 4 [31]"
|
||||
"jmp x-- loop",
|
||||
"end:",
|
||||
"irq 0 rel"
|
||||
);
|
||||
let pin0 = pio.make_pio_pin(pin0);
|
||||
let pin1 = pio.make_pio_pin(pin1);
|
||||
let pin2 = pio.make_pio_pin(pin2);
|
||||
let pin3 = pio.make_pio_pin(pin3);
|
||||
sm.set_pin_dirs(Direction::Out, &[&pin0, &pin1, &pin2, &pin3]);
|
||||
let mut cfg = Config::default();
|
||||
cfg.set_out_pins(&[&pin0, &pin1, &pin2, &pin3]);
|
||||
cfg.clock_divider = (125_000_000 / (100 * 136)).to_fixed();
|
||||
cfg.use_program(&pio.load_program(&prg.program), &[]);
|
||||
sm.set_config(&cfg);
|
||||
sm.set_enable(true);
|
||||
Self { irq, sm }
|
||||
}
|
||||
|
||||
// Set pulse frequency
|
||||
pub fn set_frequency(&mut self, freq: u32) {
|
||||
let clock_divider: FixedU32<U8> = (125_000_000 / (freq * 136)).to_fixed();
|
||||
assert!(clock_divider <= 65536, "clkdiv must be <= 65536");
|
||||
assert!(clock_divider >= 1, "clkdiv must be >= 1");
|
||||
T::PIO.sm(SM).clkdiv().write(|w| w.0 = clock_divider.to_bits() << 8);
|
||||
self.sm.clkdiv_restart();
|
||||
}
|
||||
|
||||
// Full step, one phase
|
||||
pub async fn step(&mut self, steps: i32) {
|
||||
if steps > 0 {
|
||||
self.run(steps, 0b1000_0100_0010_0001_1000_0100_0010_0001).await
|
||||
} else {
|
||||
self.run(-steps, 0b0001_0010_0100_1000_0001_0010_0100_1000).await
|
||||
}
|
||||
}
|
||||
|
||||
// Full step, two phase
|
||||
pub async fn step2(&mut self, steps: i32) {
|
||||
if steps > 0 {
|
||||
self.run(steps, 0b1001_1100_0110_0011_1001_1100_0110_0011).await
|
||||
} else {
|
||||
self.run(-steps, 0b0011_0110_1100_1001_0011_0110_1100_1001).await
|
||||
}
|
||||
}
|
||||
|
||||
// Half step
|
||||
pub async fn step_half(&mut self, steps: i32) {
|
||||
if steps > 0 {
|
||||
self.run(steps, 0b1001_1000_1100_0100_0110_0010_0011_0001).await
|
||||
} else {
|
||||
self.run(-steps, 0b0001_0011_0010_0110_0100_1100_1000_1001).await
|
||||
}
|
||||
}
|
||||
|
||||
async fn run(&mut self, steps: i32, pattern: u32) {
|
||||
self.sm.tx().wait_push(steps as u32).await;
|
||||
self.sm.tx().wait_push(pattern).await;
|
||||
let drop = OnDrop::new(|| {
|
||||
self.sm.clear_fifos();
|
||||
unsafe {
|
||||
self.sm.exec_instr(
|
||||
pio::InstructionOperands::JMP {
|
||||
address: 0,
|
||||
condition: pio::JmpCondition::Always,
|
||||
}
|
||||
.encode(),
|
||||
);
|
||||
}
|
||||
});
|
||||
self.irq.wait().await;
|
||||
drop.defuse();
|
||||
}
|
||||
}
|
||||
|
||||
struct OnDrop<F: FnOnce()> {
|
||||
f: MaybeUninit<F>,
|
||||
}
|
||||
|
||||
impl<F: FnOnce()> OnDrop<F> {
|
||||
pub fn new(f: F) -> Self {
|
||||
Self { f: MaybeUninit::new(f) }
|
||||
}
|
||||
|
||||
pub fn defuse(self) {
|
||||
mem::forget(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl<F: FnOnce()> Drop for OnDrop<F> {
|
||||
fn drop(&mut self) {
|
||||
unsafe { self.f.as_ptr().read()() }
|
||||
}
|
||||
}
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
let Pio {
|
||||
mut common, irq0, sm0, ..
|
||||
} = Pio::new(p.PIO0, Irqs);
|
||||
|
||||
let mut stepper = PioStepper::new(&mut common, sm0, irq0, p.PIN_4, p.PIN_5, p.PIN_6, p.PIN_7);
|
||||
stepper.set_frequency(120);
|
||||
loop {
|
||||
info!("CW full steps");
|
||||
stepper.step(1000).await;
|
||||
|
||||
info!("CCW full steps, drop after 1 sec");
|
||||
if let Err(_) = with_timeout(Duration::from_secs(1), stepper.step(i32::MIN)).await {
|
||||
info!("Time's up!");
|
||||
Timer::after(Duration::from_secs(1)).await;
|
||||
}
|
||||
|
||||
info!("CW half steps");
|
||||
stepper.step_half(1000).await;
|
||||
|
||||
info!("CCW half steps");
|
||||
stepper.step_half(-1000).await;
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
|
||||
use defmt::{info, panic, trace};
|
||||
use embassy_executor::Spawner;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
|
||||
use core::str::from_utf8;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
|
||||
use core::str;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
|
||||
use core::str::from_utf8;
|
||||
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["log"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["log"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["log", "std", "nightly"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] }
|
||||
embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" }
|
||||
|
@ -8,7 +8,8 @@
|
||||
//! nc 192.168.7.10 1234
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![feature(async_fn_in_trait, impl_trait_projections)]
|
||||
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
|
||||
|
||||
#[path = "../serial_port.rs"]
|
||||
mod serial_port;
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32c031c6 to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
|
||||
defmt = "0.3"
|
||||
|
@ -14,8 +14,8 @@ cortex-m-rt = "0.7.0"
|
||||
defmt = "0.3"
|
||||
defmt-rtt = "0.4"
|
||||
panic-probe = "0.3"
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
static_cell = { version = "1.1", features = ["nightly"]}
|
||||
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f103c8 to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any", "unstable-traits" ] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f207zg to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
|
||||
defmt = "0.3"
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f303ze to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f429zi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f767zi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] }
|
||||
embedded-io-async = { version = "0.6.0" }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32g071rb to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
|
||||
defmt = "0.3"
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32g491re to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32h563zi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] }
|
||||
embedded-io-async = { version = "0.6.0" }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32h743bi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "unstable-traits", "chrono"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] }
|
||||
embedded-io-async = { version = "0.6.0" }
|
||||
|
@ -12,8 +12,8 @@ nightly = ["embassy-stm32/nightly", "embassy-time/nightly", "embassy-time/unstab
|
||||
[dependencies]
|
||||
# Change stm32l072cz to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["time", "defmt"], optional = true }
|
||||
lora-phy = { version = "2", optional = true }
|
||||
|
@ -5,8 +5,8 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] }
|
||||
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32l4s5vi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "unstable-traits", "chrono"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", "unstable-traits", "nightly"] }
|
||||
embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32l552ze to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] }
|
||||
|
@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32u585ai to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
||||
|
@ -8,8 +8,8 @@ license = "MIT OR Apache-2.0"
|
||||
# Change stm32wb55rg to your chip name in both dependencies, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] }
|
||||
embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-sync = { version = "0.4.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.1", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.5", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", "nightly"], optional=true }
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user