mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
make cfail test actually fail
This commit is contained in:
parent
c749979c45
commit
72f0cc505a
2 changed files with 11 additions and 5 deletions
|
@ -106,10 +106,16 @@ pub fn app(app: &App) -> parse::Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that free interrupts are not being used
|
// Check that free interrupts are not being used
|
||||||
for int in app.interrupts.keys() {
|
for (name, interrupt) in &app.interrupts {
|
||||||
if app.free_interrupts.contains_key(int) {
|
let name = if let Some(ref binds) = interrupt.args.binds {
|
||||||
|
binds
|
||||||
|
} else {
|
||||||
|
name
|
||||||
|
};
|
||||||
|
|
||||||
|
if app.free_interrupts.contains_key(name) {
|
||||||
return Err(parse::Error::new(
|
return Err(parse::Error::new(
|
||||||
int.span(),
|
name.span(),
|
||||||
"free interrupts (`extern { .. }`) can't be used as interrupt handlers",
|
"free interrupts (`extern { .. }`) can't be used as interrupt handlers",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@ const APP: () = {
|
||||||
#[init]
|
#[init]
|
||||||
fn init() {}
|
fn init() {}
|
||||||
|
|
||||||
#[interrupt(binds = UART0)]
|
#[interrupt(binds = UART0)] //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers
|
||||||
fn foo() {} //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers
|
fn foo() {}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn UART0();
|
fn UART0();
|
||||||
|
|
Loading…
Reference in a new issue