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

with stubs

parent 096307ff
Branches
Tags
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
//#![deny(unsafe_code)] //#![deny(unsafe_code)]
// IMPORTANT always include this feature gate // IMPORTANT always include this feature gate
#![feature(proc_macro)] #![feature(proc_macro)]
#![feature(used)]
#![no_std] #![no_std]
extern crate cortex_m_rtfm as rtfm; extern crate cortex_m_rtfm as rtfm;
...@@ -56,6 +57,7 @@ fn exti1(t: &mut Threshold, EXTI1::Resources { X, mut Y }: EXTI1::Resources) { ...@@ -56,6 +57,7 @@ fn exti1(t: &mut Threshold, EXTI1::Resources { X, mut Y }: EXTI1::Resources) {
} }
}); });
}); });
rtfm::bkpt();
} }
fn exti2(t: &mut Threshold, mut r: EXTI2::Resources) { fn exti2(t: &mut Threshold, mut r: EXTI2::Resources) {
...@@ -74,14 +76,54 @@ fn exti3(_t: &mut Threshold, _r: EXTI3::Resources) {} ...@@ -74,14 +76,54 @@ fn exti3(_t: &mut Threshold, _r: EXTI3::Resources) {}
#[allow(dead_code)] #[allow(dead_code)]
fn init(_p: init::Peripherals, _r: init::Resources) {} fn init(_p: init::Peripherals, _r: init::Resources) {}
extern crate cortex_m;
use cortex_m::register::basepri;
// for wcet should be autogenerated...
#[inline(never)]
fn readbasepri() -> u8 {
cortex_m::register::basepri::read()
}
// The idle loop. // The idle loop.
// //
// This runs after `init` and has a priority of 0. All tasks can preempt this // This runs after `init` and has a priority of 0. All tasks can preempt this
// function. This function can never return so it must contain some sort of // function. This function can never return so it must contain some sort of
// endless loop. // endless loop.
#[inline(never)]
#[allow(non_snake_case)]
#[no_mangle]
fn stub_EXTI1() {
unsafe { _EXTI1() };
}
#[inline(never)]
#[no_mangle]
#[allow(non_snake_case)]
fn stub_EXTI2() {
unsafe { _EXTI2() };
}
#[inline(never)]
#[no_mangle]
#[allow(non_snake_case)]
fn stub_EXTI3() {
unsafe {
_EXTI3();
}
}
#[inline(never)] #[inline(never)]
#[allow(dead_code)]
fn idle() -> ! { fn idle() -> ! {
loop {} readbasepri();
stub_EXTI1();
stub_EXTI1();
stub_EXTI1();
loop {
rtfm::nop();
}
} }
//
//0x80001dc 0x80001dc <cortex_m_rt::reset_handler+4>
//0x8000270 0x8000270 <resource::init>
//0x8000284 0x8000284 <resource::idle+10>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment