Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
volatile-register
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
volatile-register
Commits
017ee7d8
Commit
017ee7d8
authored
6 years ago
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
dropped nightly requiremet
parent
dd032be5
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+0
-4
0 additions, 4 deletions
README.md
examples/example.rs
+1
-1
1 addition, 1 deletion
examples/example.rs
examples/example2.rs
+1
-1
1 addition, 1 deletion
examples/example2.rs
src/lib.rs
+0
-22
0 additions, 22 deletions
src/lib.rs
with
2 additions
and
28 deletions
README.md
+
0
−
4
View file @
017ee7d8
...
...
@@ -7,10 +7,6 @@
Adds debug to volatile register when compiled with
`--features debug-fmt`
.
## Caveats
Notice, the current implementation requres a nightly toolchain (
`feature(specilization`
)).
This can be
```
rust
extern
crate
volatile_register
;
...
...
This diff is collapsed.
Click to expand it.
examples/example.rs
+
1
−
1
View file @
017ee7d8
//! Example to show the use of
d
ebug
output
for small register arrays
//! Example to show the use of
`D
ebug
` formatting
for small register arrays
//!
//! > cargo run --example example2 --features debug-fmt
//!
...
...
This diff is collapsed.
Click to expand it.
examples/example2.rs
+
1
−
1
View file @
017ee7d8
//! Example to show the use of
d
ebug
output
for big register arrays
//! Example to show the use of
¡D
ebug
` formatting
for big register arrays
//!
//! > cargo run --example example2 --features debug-fmt
//!
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
0
−
22
View file @
017ee7d8
...
...
@@ -27,13 +27,11 @@
#![deny(missing_docs)]
#![no_std]
#![cfg_attr(feature
=
"debug-fmt"
,
feature(specialization))]
extern
crate
vcell
;
#[cfg(feature
=
"debug-fmt"
)]
use
core
::
fmt
::{
self
,
Debug
,
UpperHex
};
#[cfg(feature
=
"debug-fmt"
)]
use
vcell
::
VolatileCell
;
/// Read-Only register
...
...
@@ -44,16 +42,6 @@ where
register
:
VolatileCell
<
T
>
,
}
#[cfg(feature
=
"debug-fmt"
)]
impl
<
T
>
fmt
::
Debug
for
RO
<
T
>
where
T
:
Copy
+
Debug
,
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
write!
(
f
,
"{:?}"
,
self
.read
())
}
}
#[cfg(feature
=
"debug-fmt"
)]
impl
<
T
>
fmt
::
Debug
for
RO
<
T
>
where
...
...
@@ -75,16 +63,6 @@ where
}
}
#[cfg(feature
=
"debug-fmt"
)]
impl
<
T
>
fmt
::
Debug
for
RW
<
T
>
where
T
:
Copy
+
Debug
,
{
default
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
write!
(
f
,
"{:?}"
,
self
.read
())
}
}
#[cfg(feature
=
"debug-fmt"
)]
impl
<
T
>
fmt
::
Debug
for
RW
<
T
>
where
...
...
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