summaryrefslogtreecommitdiff
path: root/examples/stm32f4/src/bin/hello.rs
blob: 8059f4b5a543e9b01d13a0823847e9bf16769f68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#![no_std]
#![no_main]
#![feature(trait_alias)]
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]

use defmt::info;
use embassy::executor::Spawner;
use embassy::time::{Duration, Timer};
use embassy_stm32::time::Hertz;
use embassy_stm32::Config;
use embassy_stm32::Peripherals;

#[path = "../example_common.rs"]
mod example_common;

fn config() -> Config {
    let mut config = Config::default();
    config.rcc.sys_ck = Some(Hertz(84_000_000));
    config
}

#[embassy::main(config = "config()")]
async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
    loop {
        info!("Hello World!");
        Timer::after(Duration::from_secs(1)).await;
    }
}