Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e7020e_2020
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
Anton Grahn
e7020e_2020
Commits
cbafba1b
Commit
cbafba1b
authored
5 years ago
by
Anton Grahn
Browse files
Options
Downloads
Patches
Plain Diff
bare5_1
parent
6b7eff1b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/bare5.rs
+4
-4
4 additions, 4 deletions
examples/bare5.rs
with
4 additions
and
4 deletions
examples/bare5.rs
+
4
−
4
View file @
cbafba1b
...
...
@@ -188,20 +188,20 @@ fn idle(rcc: &mut RCC, gpioa: &mut GPIOA) {
loop
{
// set PA5 high
gpioa
.BSRRH
.write
(
1
<<
5
);
// set bit, output hight (turn on led)
//
gpioa.BSRRH.write(1 << 5); // set bit, output hight (turn on led)
// alternatively to set the bit high we can
// read the value, or with PA5 (bit 5) and write back
//
gpioa.ODR.write(gpioa.ODR.read() | (1 << 5));
gpioa
.ODR
.write
(
gpioa
.ODR
.read
()
|
(
1
<<
5
));
wait
(
10_000
);
// set PA5 low
gpioa
.BSRRL
.write
(
1
<<
5
);
// clear bit, output low (turn off led)
//
gpioa.BSRRL.write(1 << 5); // clear bit, output low (turn off led)
// alternatively to clear the bit we can
// read the value, mask out PA5 (bit 5) and write back
//
gpioa.ODR.write(gpioa.ODR.read() & !(1 << 5));
gpioa
.ODR
.write
(
gpioa
.ODR
.read
()
&
!
(
1
<<
5
));
wait
(
10_000
);
}
}
...
...
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