Skip to content
Snippets Groups Projects
Commit c24284b1 authored by Per Lindgren's avatar Per Lindgren
Browse files

updated exompples toml, and klee option

parent 24a66afa
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,7 @@ fn run() -> Result<i32, failure::Error> { ...@@ -104,7 +104,7 @@ fn run() -> Result<i32, failure::Error> {
let verbose = matches.is_present("verbose"); let verbose = matches.is_present("verbose");
let is_release = matches.is_present("release"); let is_release = matches.is_present("release");
let is_replay = matches.is_present("replay"); let is_replay = matches.is_present("replay");
let is_ktest = matches.is_present("ktest"); let is_ktest = matches.is_present("klee");
let is_gdb = matches.is_present("gdb"); let is_gdb = matches.is_present("gdb");
// let target_flag = matches.value_of("target"); // not currently supported // let target_flag = matches.value_of("target"); // not currently supported
......
//! $ cargo klee --example gpioa --features klee-device
//!
#![no_std] #![no_std]
#![no_main] #![no_main]
...@@ -6,18 +8,19 @@ extern crate klee; ...@@ -6,18 +8,19 @@ extern crate klee;
extern crate panic_abort; extern crate panic_abort;
extern crate stm32f413; extern crate stm32f413;
use core::ptr;
use cortex_m::peripheral::Peripherals; use cortex_m::peripheral::Peripherals;
#[no_mangle] #[no_mangle]
fn main() { fn main() {
// accesss to core peripherals
let peripherals = Peripherals::take().unwrap(); let peripherals = Peripherals::take().unwrap();
let syst = peripherals.SYST; let syst = peripherals.SYST;
// access to device peripherals
let p = stm32f413::Peripherals::take().unwrap(); let p = stm32f413::Peripherals::take().unwrap();
let gpioa = p.GPIOA; let gpioa = p.GPIOA;
if gpioa.moder.read().bits() == 0 { if gpioa.moder.read().bits() == 0 && syst.rvr.read() == 0 {
let p = Peripherals::take().unwrap(); let _p = Peripherals::take().unwrap();
} }
} }
...@@ -9,6 +9,7 @@ use cortex_m::peripheral::Peripherals; ...@@ -9,6 +9,7 @@ use cortex_m::peripheral::Peripherals;
#[no_mangle] #[no_mangle]
fn main() { fn main() {
// access to core peripherals
let peripherals = Peripherals::take().unwrap(); let peripherals = Peripherals::take().unwrap();
let syst = peripherals.SYST; let syst = peripherals.SYST;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment