Skip to content
Snippets Groups Projects
Commit acdfa6f0 authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

drop the Ceiling newtype

it's not required as the user never deal with Ceiling tokens
parent c1a0f817
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ fn main() { ...@@ -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;
}, },
); );
......
...@@ -494,7 +494,7 @@ pub struct Resource<T, C> { ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 { ...@@ -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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment