Skip to content

Commit 107f0d8

Browse files
committed
Use RTIC v0.5 alongside cortex-m v0.7
Using feature flag added in rtic-rs/rtic#509
1 parent cbb803e commit 107f0d8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ default-features = false
5252
optional = true
5353

5454
[dev-dependencies]
55-
cortex-m-rtic = "0.5.3"
55+
cortex-m-rtic = { version = "0.5.8", default-features = false, features = ["cortex-m-7"] }
5656
log = "0.4.11"
5757
panic-halt = "0.2.0"
5858
cfg-if = "0.1.10"

examples/rtic_low_power.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
//! After the end of init the CPU transitions into CStop mode, and D1/D2
44
//! (aka. CD) transition into DStop mode.
55
//!
6-
//! However we set the run_d3 flag, and enable Autonomous mode on the LPTIM3
7-
//! PREC struture. Therefore LPTIM3 continues to run and fires an interrupt that
8-
//! wakes the core. Following each interrupt the core returns to CStop mode.
6+
//! However we set the run_d3/run_srd flag, and enable Autonomous mode on the
7+
//! LPTIM3 PREC struture. Therefore LPTIM3 continues to run and fires an
8+
//! interrupt that wakes the core. Following each interrupt the core returns to
9+
//! CStop mode.
910
//!
1011
//! On the first rising edge on PC13, the EXTI interrupt fires. We do not clear
1112
//! this interrupt, so we loop in the handler forever.
@@ -47,7 +48,10 @@ const APP: () = {
4748
let mut syscfg = ctx.device.SYSCFG;
4849

4950
// Run D3 / SRD domain
51+
#[cfg(not(feature = "rm0455"))]
5052
ctx.device.PWR.cpucr.modify(|_, w| w.run_d3().set_bit());
53+
#[cfg(feature = "rm0455")] // 7b3/7a3/7b0 parts
54+
ctx.device.PWR.cpucr.modify(|_, w| w.run_srd().set_bit());
5155

5256
let pwr = ctx.device.PWR.constrain();
5357
let vos = pwr.freeze();

0 commit comments

Comments
 (0)