Skip to content

Commit 92829a9

Browse files
committed
stm32: remove internal-only _allow-disable-rtc.
1 parent 0f59f10 commit 92829a9

File tree

7 files changed

+2
-27
lines changed

7 files changed

+2
-27
lines changed

embassy-stm32/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ gpio-init-analog = []
348348

349349
## internal use only
350350
_split-pins-enabled = []
351-
_allow-disable-rtc = []
352351

353352
## internal use only
354353
_dual-core = []

embassy-stm32/src/rtc/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,13 @@ pub struct RtcConfig {
176176
///
177177
/// A high counter frequency may impact stop power consumption
178178
pub frequency: Hertz,
179-
180-
#[cfg(feature = "_allow-disable-rtc")]
181-
/// Allow disabling the rtc, even when stop is configured
182-
pub _disable_rtc: bool,
183179
}
184180

185181
impl Default for RtcConfig {
186182
/// LSI with prescalers assuming 32.768 kHz.
187183
/// Raw sub-seconds in 1/256.
188184
fn default() -> Self {
189-
RtcConfig {
190-
frequency: Hertz(256),
191-
#[cfg(feature = "_allow-disable-rtc")]
192-
_disable_rtc: false,
193-
}
185+
RtcConfig { frequency: Hertz(256) }
194186
}
195187
}
196188

@@ -451,11 +443,6 @@ trait SealedInstance {
451443
pub(crate) fn init_rtc(cs: CriticalSection, config: RtcConfig, min_stop_pause: embassy_time::Duration) {
452444
use crate::time_driver::{LPTimeDriver, get_driver};
453445

454-
#[cfg(feature = "_allow-disable-rtc")]
455-
if config._disable_rtc {
456-
return;
457-
}
458-
459446
get_driver().set_rtc(cs, Rtc::new_inner(config));
460447
get_driver().set_min_stop_pause(cs, min_stop_pause);
461448

tests/stm32/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ teleprobe-meta = "1"
7777
embassy-sync = { version = "0.8.0", path = "../../embassy-sync", features = ["defmt"] }
7878
embassy-executor = { version = "0.10.0", path = "../../embassy-executor", features = ["defmt"] }
7979
embassy-time = { version = "0.5.1", path = "../../embassy-time", features = ["defmt", "tick-hz-131_072", "defmt-timestamp-uptime"] }
80-
embassy-stm32 = { version = "0.6.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "memory-x", "time-driver-any", "_allow-disable-rtc"] }
80+
embassy-stm32 = { version = "0.6.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "memory-x", "time-driver-any"] }
8181
embassy-futures = { version = "0.1.2", path = "../../embassy-futures" }
8282
embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", optional = true, features = ["defmt", "stm32wb55rg", "wb55_ble"] }
8383
embassy-net = { version = "0.9.0", path = "../../embassy-net", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet"] }

tests/stm32/src/bin/rtc.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ use embassy_time::Timer;
2323
async fn main(_spawner: Spawner) {
2424
let mut config = config();
2525
config.rcc.ls = LsConfig::default_lse();
26-
#[cfg(feature = "stop")]
27-
{
28-
config.rtc._disable_rtc = false;
29-
}
3026

3127
let p = init_with_config(config);
3228
info!("Hello World!");

tests/stm32/src/bin/stop.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ async fn async_main(spawner: Spawner) {
5151

5252
let mut config = Config::default();
5353
config.rcc.ls = LsConfig::default_lse();
54-
config.rtc._disable_rtc = false;
5554

5655
// System Clock seems cannot be greater than 16 MHz
5756
#[cfg(any(feature = "stm32h563zi", feature = "stm32h503rb"))]

tests/stm32/src/bin/timer.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ async fn main(_spawner: Spawner) {
1919
let _p = init();
2020
info!("Hello World!");
2121

22-
// TODO: investigate. Test fails with low-power executor.
23-
#[cfg(all(feature = "stop", feature = "stm32h563zi"))]
24-
let _guard = embassy_stm32::rcc::WakeGuard::new(embassy_stm32::rcc::StopMode::Stop1);
25-
2622
let start = Instant::now();
2723
Timer::after_millis(100).await;
2824
let end = Instant::now();

tests/stm32/src/common.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,6 @@ pub fn config() -> Config {
623623
config.rcc.apb3_pre = APBPrescaler::DIV1;
624624
config.rcc.sys = Sysclk::PLL1_P;
625625
config.rcc.voltage_scale = VoltageScale::Scale0;
626-
627-
config.rtc._disable_rtc = true;
628626
}
629627

630628
#[cfg(feature = "stm32h503rb")]

0 commit comments

Comments
 (0)