mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-24 02:49:34 +01:00
adapt to changes in rtfm-syntax
This commit is contained in:
parent
2f4f185778
commit
0e146f8d11
11 changed files with 28 additions and 14 deletions
|
@ -5,20 +5,26 @@ matrix:
|
|||
# NOTE used to build docs on successful merges to master
|
||||
- env: TARGET=x86_64-unknown-linux-gnu
|
||||
|
||||
# MSRV
|
||||
- env: TARGET=thumbv7m-none-eabi
|
||||
rust: 1.36.0
|
||||
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
|
||||
|
||||
- env: TARGET=thumbv6m-none-eabi
|
||||
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
|
||||
|
||||
- env: TARGET=thumbv7m-none-eabi
|
||||
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
|
||||
|
||||
# compile-fail tests
|
||||
- env: TARGET=x86_64-unknown-linux-gnu
|
||||
rust: nightly
|
||||
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
|
||||
|
||||
# heterogeneous multi-core support
|
||||
- env: TARGET=thumbv6m-none-eabi
|
||||
rust: nightly
|
||||
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
|
||||
|
||||
- env: TARGET=thumbv7m-none-eabi
|
||||
rust: nightly
|
||||
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
|
||||
|
|
|
@ -15,9 +15,9 @@ version = "0.5.0-alpha.1"
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "0.4.30"
|
||||
quote = "0.6.12"
|
||||
syn = "0.15.34"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = "1"
|
||||
|
||||
[dependencies.rtfm-syntax]
|
||||
git = "https://github.com/japaric/rtfm-syntax"
|
||||
|
|
|
@ -169,9 +169,10 @@ pub fn app<'a>(app: &'a App, analysis: &Analysis) -> parse::Result<Extra<'a>> {
|
|||
peripherals = if *x { Some(0) } else { None }
|
||||
}
|
||||
|
||||
CustomArg::UInt(x) if app.args.cores != 1 => {
|
||||
peripherals = if *x < u64::from(app.args.cores) {
|
||||
Some(*x as u8)
|
||||
CustomArg::UInt(s) if app.args.cores != 1 => {
|
||||
let x = s.parse::<u8>().ok();
|
||||
peripherals = if x.is_some() && x.unwrap() < app.args.cores {
|
||||
Some(x.unwrap())
|
||||
} else {
|
||||
return Err(parse::Error::new(
|
||||
k.span(),
|
||||
|
|
|
@ -126,7 +126,7 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
|||
|
||||
#(#root)*
|
||||
|
||||
#(#mod_resources)*
|
||||
#mod_resources
|
||||
|
||||
#(#root_hardware_tasks)*
|
||||
|
||||
|
|
|
@ -115,6 +115,7 @@ pub fn codegen(
|
|||
let stmts = &task.stmts;
|
||||
let section = util::link_section("text", core);
|
||||
// XXX shouldn't this have a cfg_core?
|
||||
let locals_pat = locals_pat.iter();
|
||||
user_tasks.push(quote!(
|
||||
#(#attrs)*
|
||||
#[allow(non_snake_case)]
|
||||
|
|
|
@ -58,6 +58,7 @@ pub fn codegen(
|
|||
let context = &idle.context;
|
||||
let stmts = &idle.stmts;
|
||||
let section = util::link_section("text", core);
|
||||
let locals_pat = locals_pat.iter();
|
||||
let user_idle = Some(quote!(
|
||||
#(#attrs)*
|
||||
#[allow(non_snake_case)]
|
||||
|
@ -70,6 +71,7 @@ pub fn codegen(
|
|||
}
|
||||
));
|
||||
|
||||
let locals_new = locals_new.iter();
|
||||
let call_idle = quote!(#name(
|
||||
#(#locals_new,)*
|
||||
#name::Context::new(&rtfm::export::Priority::new(0))
|
||||
|
|
|
@ -83,6 +83,7 @@ pub fn codegen(
|
|||
let attrs = &init.attrs;
|
||||
let stmts = &init.stmts;
|
||||
let section = util::link_section("text", core);
|
||||
let locals_pat = locals_pat.iter();
|
||||
let user_init = Some(quote!(
|
||||
#(#attrs)*
|
||||
#cfg_core
|
||||
|
@ -102,6 +103,7 @@ pub fn codegen(
|
|||
const_app = Some(constructor);
|
||||
}
|
||||
|
||||
let locals_new = locals_new.iter();
|
||||
let call_init =
|
||||
Some(quote!(let late = #name(#(#locals_new,)* #name::Context::new(core.into()));));
|
||||
|
||||
|
|
|
@ -168,6 +168,7 @@ pub fn codegen(
|
|||
let attrs = &task.attrs;
|
||||
let cfgs = &task.cfgs;
|
||||
let stmts = &task.stmts;
|
||||
let locals_pat = locals_pat.iter();
|
||||
user_tasks.push(quote!(
|
||||
#(#attrs)*
|
||||
#(#cfgs)*
|
||||
|
|
|
@ -3,13 +3,13 @@ use core::sync::atomic::{AtomicUsize, Ordering};
|
|||
use proc_macro2::{Span, TokenStream as TokenStream2};
|
||||
use quote::quote;
|
||||
use rtfm_syntax::{ast::App, Context, Core};
|
||||
use syn::{ArgCaptured, Attribute, Ident, IntSuffix, LitInt};
|
||||
use syn::{Attribute, Ident, LitInt, PatType};
|
||||
|
||||
use crate::check::Extra;
|
||||
|
||||
/// Turns `capacity` into an unsuffixed integer literal
|
||||
pub fn capacity_literal(capacity: u8) -> LitInt {
|
||||
LitInt::new(u64::from(capacity), IntSuffix::None, Span::call_site())
|
||||
LitInt::new(&capacity.to_string(), Span::call_site())
|
||||
}
|
||||
|
||||
/// Turns `capacity` into a type-level (`typenum`) integer
|
||||
|
@ -194,7 +194,7 @@ pub fn rendezvous_ident(core: Core) -> Ident {
|
|||
//
|
||||
// `inputs` could be &[`input: Foo`] OR &[`mut x: i32`, `ref y: i64`]
|
||||
pub fn regroup_inputs(
|
||||
inputs: &[ArgCaptured],
|
||||
inputs: &[PatType],
|
||||
) -> (
|
||||
// args e.g. &[`_0`], &[`_0: i32`, `_1: i64`]
|
||||
Vec<TokenStream2>,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![deny(warnings)]
|
||||
#![recursion_limit = "128"]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ fn ui() {
|
|||
|
||||
config.mode = Mode::Ui;
|
||||
config.src_base = PathBuf::from("ui/single");
|
||||
config.target_rustcflags =
|
||||
Some("--edition=2018 -L target/debug/deps -Z unstable-options --extern rtfm --extern lm3s6965".to_owned());
|
||||
config.target_rustcflags = Some(
|
||||
"--edition=2018 -L target/debug/deps -Z unstable-options --extern rtfm --extern lm3s6965"
|
||||
.to_owned(),
|
||||
);
|
||||
config.link_deps();
|
||||
config.clean_rmeta();
|
||||
|
||||
|
|
Loading…
Reference in a new issue