Skip to content
Snippets Groups Projects
Select Git revision
  • 5e2f0e81bb2bccfb08341a06c06e45fb78fd49ca
  • master default protected
2 results

itm_rtic_hello.rs

Blame
  • itm_rtic_hello.rs 508 B
    #![no_main]
    #![no_std]
    
    use cortex_m::iprintln;
    use panic_halt as _;
    use stm32f4;
    
    #[rtic::app(device = stm32f4)]
    const APP: () = {
        #[init]
        fn init(cx: init::Context) {
            // Set up the system clock.
            let rcc = ctx.device.RCC.constrain();
            let _clocks = rcc.cfgr.sysclk(48.mhz()).require_pll48clk().freeze();
    
            let mut p = cx.core;
            let stim = &mut p.ITM.stim[0];
            for a in 0..=10 {
                iprintln!(stim, "RTIC Hello, world!! {}", a);
            }
        }
    };