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

hello.rs

Blame
  • cortex_m_rt_test2.rs 525 B
    #![no_std]
    #![no_main]
    
    use cortex_m_rt::{entry, pre_init};
    use panic_klee as _;
    
    use klee_sys::klee_abort;
    
    use cortex_m::peripheral::Peripherals;
    
    const X: u32 = 100;
    
    #[entry]
    unsafe fn main() -> ! {
        let peripherals = Peripherals::take().unwrap();
        let mut dwt = peripherals.DWT;
        dwt.enable_cycle_counter();
        let a = dwt.cyccnt.read();
        match a {
            0 => klee_abort!(),
            X => klee_abort!(),
            _ => (),
        }
        klee_abort!();
    }
    
    #[pre_init]
    unsafe fn pre_init() {}
    
    // This is the way!