mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-30 15:34:33 +01:00
Remove parsing on capacity
This commit is contained in:
parent
87aa9df129
commit
a04f127a09
2 changed files with 0 additions and 47 deletions
|
@ -367,9 +367,6 @@ pub type SyncTypes = Set<Box<Type>>;
|
||||||
/// A channel used to send messages
|
/// A channel used to send messages
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct Channel {
|
pub struct Channel {
|
||||||
/// The channel capacity
|
|
||||||
pub capacity: u8,
|
|
||||||
|
|
||||||
/// Tasks that can be spawned on this channel
|
/// Tasks that can be spawned on this channel
|
||||||
pub tasks: BTreeSet<Task>,
|
pub tasks: BTreeSet<Task>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,6 @@ fn task_args(tokens: TokenStream2) -> parse::Result<Either<HardwareTaskArgs, Sof
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut binds = None;
|
let mut binds = None;
|
||||||
let mut capacity = None;
|
|
||||||
let mut priority = None;
|
let mut priority = None;
|
||||||
let mut shared_resources = None;
|
let mut shared_resources = None;
|
||||||
let mut local_resources = None;
|
let mut local_resources = None;
|
||||||
|
@ -220,55 +219,12 @@ fn task_args(tokens: TokenStream2) -> parse::Result<Either<HardwareTaskArgs, Sof
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if capacity.is_some() {
|
|
||||||
return Err(parse::Error::new(
|
|
||||||
ident.span(),
|
|
||||||
"hardware tasks can't use the `capacity` argument",
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse identifier name
|
// Parse identifier name
|
||||||
let ident = content.parse()?;
|
let ident = content.parse()?;
|
||||||
|
|
||||||
binds = Some(ident);
|
binds = Some(ident);
|
||||||
}
|
}
|
||||||
|
|
||||||
"capacity" => {
|
|
||||||
if capacity.is_some() {
|
|
||||||
return Err(parse::Error::new(
|
|
||||||
ident.span(),
|
|
||||||
"argument appears more than once",
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
if binds.is_some() {
|
|
||||||
return Err(parse::Error::new(
|
|
||||||
ident.span(),
|
|
||||||
"hardware tasks can't use the `capacity` argument",
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// #lit
|
|
||||||
let lit: LitInt = content.parse()?;
|
|
||||||
|
|
||||||
if !lit.suffix().is_empty() {
|
|
||||||
return Err(parse::Error::new(
|
|
||||||
lit.span(),
|
|
||||||
"this literal must be unsuffixed",
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
let value = lit.base10_parse::<u8>().ok();
|
|
||||||
if value.is_none() || value == Some(0) {
|
|
||||||
return Err(parse::Error::new(
|
|
||||||
lit.span(),
|
|
||||||
"this literal must be in the range 1...255",
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
capacity = Some(value.unwrap());
|
|
||||||
}
|
|
||||||
|
|
||||||
"priority" => {
|
"priority" => {
|
||||||
if priority.is_some() {
|
if priority.is_some() {
|
||||||
return Err(parse::Error::new(
|
return Err(parse::Error::new(
|
||||||
|
|
Loading…
Reference in a new issue