diff options
author | 2018-06-13 23:22:12 +0100 | |
---|---|---|
committer | 2018-06-13 23:22:12 +0100 | |
commit | 21c205462686554d0d639834fc7d38e84608f11a (patch) | |
tree | 6c6025945940f02a604136995f360dd3ef45c2be /cortex-m-rt/examples/main.rs | |
parent | c259cf9522b36b65b91055b03600bb10afc86930 (diff) | |
download | cortex-m-21c205462686554d0d639834fc7d38e84608f11a.tar.gz cortex-m-21c205462686554d0d639834fc7d38e84608f11a.tar.zst cortex-m-21c205462686554d0d639834fc7d38e84608f11a.zip |
Modified the entry and exception macros to accept a closure.
This allows:
entry!(|| {
let mut x = 1;
loop {
x = x + 1;
}
});
as well as allowing the original usage:
entry!(main);
fn main() -> ! {
let mut x = 1;
loop {
x = x + 1;
}
}
The same is true for exceptions:
exception!(*, |irqn: i16| {
panic!("Unhandled exception (IRQn = {})", irqn);
});
Diffstat (limited to 'cortex-m-rt/examples/main.rs')
0 files changed, 0 insertions, 0 deletions