Skip to content
Snippets Groups Projects
Select Git revision
  • d2b6104af491d3c9d2c16dc7699c49d639efb15f
  • master default protected
  • exam
  • exper
  • klee
  • simple
  • v0.3.2
  • v0.3.1
  • v0.3.0
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.1
  • v0.1.0
14 results

resource.rs

Blame
  • loop.rs 662 B
    //! Nesting claims and how the preemption threshold works
    //!
    //! If you run this program you'll hit the breakpoints as indicated by the
    //! letters in the comments: A, then B, then C, etc.
    #![deny(unsafe_code)]
    #![feature(proc_macro)]
    #![no_std]
    
    extern crate cortex_m;
    extern crate cortex_m_rtfm as rtfm;
    extern crate stm32f40x;
    
    #[macro_use]
    extern crate cortex_m_debug;
    
    use rtfm::app;
    
    app! {
        device: stm32f40x,
    }
    
    fn init(_p: init::Peripherals) {
        let mut sum = 0;
        for i in 0..10 {
            ipln!("i = {}", i);
            sum += i;
        }
        ipln!("Sum 0..10 = {}", sum);
    }
    
    #[inline(never)]
    fn idle() -> ! {
        loop {
            rtfm::wfi();
        }
    }