Skip to main content
Homepage
Explore
Search or go to…
/
Register
Sign in
Explore
Primary navigation
Project
E
e7020e_2021
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Josef Utbult
e7020e_2021
Commits
f5076677
Commit
f5076677
authored
Mar 5, 2021
by
Josef Utbult
Browse files
Options
Downloads
Patches
Plain Diff
bare5_1
parent
ae61fba0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/rtic_bare5.rs
+6
-4
6 additions, 4 deletions
examples/rtic_bare5.rs
with
6 additions
and
4 deletions
examples/rtic_bare5.rs
+
6
−
4
View file @
f5076677
...
@@ -181,20 +181,20 @@ const APP: () = {
...
@@ -181,20 +181,20 @@ const APP: () = {
loop
{
loop
{
// set PA5 high
// 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
// alternatively to set the bit high we can
// read the value, or with PA5 (bit 5) and write back
// 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
);
wait
(
10_000
);
// set PA5 low
// 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
// alternatively to clear the bit we can
// read the value, mask out PA5 (bit 5) and write back
// 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
);
wait
(
10_000
);
}
}
}
}
...
@@ -214,6 +214,8 @@ const APP: () = {
...
@@ -214,6 +214,8 @@ const APP: () = {
//
//
// Run and see that the program behaves the same.
// Run and see that the program behaves the same.
//
//
// It does blink the same if thats what you mean.
//
// Commit your answers (bare5_1)
// Commit your answers (bare5_1)
//
//
// 2. Extend the read/write API with a `modify` for u32, taking the
// 2. Extend the read/write API with a `modify` for u32, taking the
...
...
...
...
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