aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorThales Fragoso <[email protected]>2021-07-28 16:02:56 -0300
committerThales Fragoso <[email protected]>2021-07-29 18:43:15 -0300
commite7714983b3f6ff5084e1cb27bc4de794f98081fd (patch)
treeccedd3ed5d3f51627b60f1216e8da9098947e623 /examples
parent5abaf8e9d6a673bbbf7e900b15a77d6e7d1a2962 (diff)
f4-rcc: Add option to enable debug_wfe and add hello example
Diffstat (limited to 'examples')
-rw-r--r--examples/stm32f4/src/bin/hello.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/stm32f4/src/bin/hello.rs b/examples/stm32f4/src/bin/hello.rs
new file mode 100644
index 000000000..8d4be7150
--- /dev/null
+++ b/examples/stm32f4/src/bin/hello.rs
@@ -0,0 +1,34 @@
1#![no_std]
2#![no_main]
3#![feature(trait_alias)]
4#![feature(min_type_alias_impl_trait)]
5#![feature(impl_trait_in_bindings)]
6#![feature(type_alias_impl_trait)]
7#![allow(incomplete_features)]
8
9use defmt::{info, panic};
10use embassy::executor::Spawner;
11use embassy::time::{Duration, Timer};
12use embassy_stm32::rcc::Config as RccConfig;
13use embassy_stm32::time::Hertz;
14use embassy_stm32::Config;
15use embassy_stm32::Peripherals;
16
17#[path = "../example_common.rs"]
18mod example_common;
19
20fn config() -> Config {
21 let mut rcc_config = RccConfig::default();
22 rcc_config.sys_ck = Some(Hertz(32_000_000));
23 rcc_config.enable_debug_wfe = true;
24
25 Config::default().rcc(rcc_config)
26}
27
28#[embassy::main(config = "config()")]
29async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
30 loop {
31 info!("Hello World!");
32 Timer::after(Duration::from_secs(1)).await;
33 }
34}