mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
drop the Ceiling newtype
it's not required as the user never deal with Ceiling tokens
This commit is contained in:
parent
c1a0f8173a
commit
acdfa6f09d
2 changed files with 7 additions and 14 deletions
2
build.rs
2
build.rs
|
@ -49,7 +49,7 @@ fn main() {
|
||||||
tokens.push(
|
tokens.push(
|
||||||
quote! {
|
quote! {
|
||||||
#[doc = #doc]
|
#[doc = #doc]
|
||||||
pub type #c = Ceiling<::typenum::#u>;
|
pub type #c = ::typenum::#u;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
19
src/lib.rs
19
src/lib.rs
|
@ -494,7 +494,7 @@ pub struct Resource<T, C> {
|
||||||
data: UnsafeCell<T>,
|
data: UnsafeCell<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, RC> Resource<T, Ceiling<RC>>
|
impl<T, RC> Resource<T, RC>
|
||||||
where
|
where
|
||||||
RC: GreaterThanOrEqual<U0>,
|
RC: GreaterThanOrEqual<U0>,
|
||||||
RC: LessThanOrEqual<UMax>,
|
RC: LessThanOrEqual<UMax>,
|
||||||
|
@ -508,7 +508,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, RC> Resource<T, Ceiling<RC>> {
|
impl<T, RC> Resource<T, RC> {
|
||||||
/// Grants data race free and deadlock free access to the resource data
|
/// Grants data race free and deadlock free access to the resource data
|
||||||
///
|
///
|
||||||
/// This operation is zero cost and doesn't impose any additional blocking.
|
/// This operation is zero cost and doesn't impose any additional blocking.
|
||||||
|
@ -552,7 +552,7 @@ where
|
||||||
_ceiling: PhantomData<PC>,
|
_ceiling: PhantomData<PC>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<P, PC> Peripheral<P, Ceiling<PC>>
|
impl<P, PC> Peripheral<P, PC>
|
||||||
where
|
where
|
||||||
PC: GreaterThanOrEqual<U0>,
|
PC: GreaterThanOrEqual<U0>,
|
||||||
PC: LessThanOrEqual<UMax>,
|
PC: LessThanOrEqual<UMax>,
|
||||||
|
@ -567,7 +567,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Periph, PC> Peripheral<Periph, Ceiling<PC>> {
|
impl<Periph, PC> Peripheral<Periph, PC> {
|
||||||
/// See [Resource.access](./struct.Resource.html#method.access)
|
/// See [Resource.access](./struct.Resource.html#method.access)
|
||||||
pub fn access<'cs, TP, PT>(
|
pub fn access<'cs, TP, PT>(
|
||||||
&'static self,
|
&'static self,
|
||||||
|
@ -684,13 +684,6 @@ where
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resource ceiling
|
|
||||||
pub struct Ceiling<N> {
|
|
||||||
_marker: PhantomData<N>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<N> !Send for Ceiling<N> {}
|
|
||||||
|
|
||||||
/// Preemption threshold
|
/// Preemption threshold
|
||||||
pub struct Threshold<T> {
|
pub struct Threshold<T> {
|
||||||
_marker: PhantomData<T>,
|
_marker: PhantomData<T>,
|
||||||
|
@ -744,11 +737,11 @@ pub unsafe trait ResourceLike {
|
||||||
type Ceiling;
|
type Ceiling;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<P, PC> ResourceLike for Peripheral<P, Ceiling<PC>> {
|
unsafe impl<P, PC> ResourceLike for Peripheral<P, PC> {
|
||||||
type Ceiling = PC;
|
type Ceiling = PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<T, RC> ResourceLike for Resource<T, Ceiling<RC>> {
|
unsafe impl<T, RC> ResourceLike for Resource<T, RC> {
|
||||||
type Ceiling = RC;
|
type Ceiling = RC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue