mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 06:15:45 +01:00
rtfm-syntax refactor + heterogeneous multi-core support
This commit is contained in:
parent
fafeeb2727
commit
81275bfa4f
127 changed files with 4072 additions and 5848 deletions
35
macros/src/tests/single.rs
Normal file
35
macros/src/tests/single.rs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
use quote::quote;
|
||||
use rtfm_syntax::Settings;
|
||||
|
||||
#[test]
|
||||
fn analyze() {
|
||||
let (app, analysis) = rtfm_syntax::parse2(
|
||||
quote!(device = pac),
|
||||
quote!(
|
||||
const APP: () = {
|
||||
#[task(priority = 1)]
|
||||
fn a(_: a::Context) {}
|
||||
|
||||
#[task(priority = 2)]
|
||||
fn b(_: b::Context) {}
|
||||
|
||||
// first interrupt is assigned to the highest priority dispatcher
|
||||
extern "C" {
|
||||
fn B();
|
||||
fn A();
|
||||
}
|
||||
};
|
||||
),
|
||||
Settings {
|
||||
parse_extern_interrupt: true,
|
||||
..Settings::default()
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let analysis = crate::analyze::app(analysis, &app);
|
||||
let interrupts = &analysis.interrupts[&0];
|
||||
assert_eq!(interrupts.len(), 2);
|
||||
assert_eq!(interrupts[&2].to_string(), "B");
|
||||
assert_eq!(interrupts[&1].to_string(), "A");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue