Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lpc1769
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
lpc1769
Commits
acdfa6f0
Commit
acdfa6f0
authored
8 years ago
by
Jorge Aparicio
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.rs
+1
-1
1 addition, 1 deletion
build.rs
src/lib.rs
+6
-13
6 additions, 13 deletions
src/lib.rs
with
7 additions
and
14 deletions
build.rs
+
1
−
1
View file @
acdfa6f0
...
@@ -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
;
},
},
);
);
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
6
−
13
View file @
acdfa6f0
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment