Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e7020e_2019
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
August Svensson
e7020e_2019
Commits
a6118ca6
Commit
a6118ca6
authored
6 years ago
by
August Svensson
Browse files
Options
Downloads
Patches
Plain Diff
merge conflict...
parent
7d5110c3
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/bare5.rs
+1
-18
1 addition, 18 deletions
examples/bare5.rs
with
1 addition
and
18 deletions
examples/bare5.rs
+
1
−
18
View file @
a6118ca6
...
...
@@ -199,29 +199,19 @@ fn idle(rcc: &mut RCC, gpioa: &mut GPIOA) {
let
led_odr
=
&
gpioa
.ODR
;
loop
{
// set PA5 high
<<<<<<<
HEAD
// gpioa.BSRRH.write(1 << 5); // set bit, output hight (turn on led)
gpioa
.ODR
.write
(
gpioa
.ODR
.read
()
|
(
1
<<
5
));
=======
// gpioa.ODR.modify(5u8, 1u8, 1u32);
led_odr
.modify
(
5u8
,
1u8
,
1u32
);
// gpioa.BSRRH.write(1 << 5); // set bit, output hight (turn on led)
// gpioa.ODR.write(gpioa.ODR.read() | (1 << 5));
>>>>>>>
student
-
1
wait
(
10_000
);
// set PA5 low
<<<<<<<
HEAD
// gpioa.BSRRL.write(1 << 5); // clear bit, output low (turn off led)
gpioa
.ODR
.write
(
gpioa
.ODR
.read
()
&
!
(
1
<<
5
));
=======
// gpioa.ODR.modify(5u8, 1u8, 0u32);
led_odr
.modify
(
5u8
,
1u8
,
0u32
);
// gpioa.BSRRL.write(1 << 5); // clear bit, output low (turn off led)
// gpioa.ODR.write(gpioa.ODR.read() & !(1 << 5));
>>>>>>>
student
-
1
wait
(
10_000
);
}
}
...
...
@@ -271,10 +261,3 @@ fn idle(rcc: &mut RCC, gpioa: &mut GPIOA) {
// Notice, over-shifting (where bits are spilled) is always considered legal,
// its just the shift amuount that is checked.
// There are explicit unchecked versions available if so wanted.
\ No newline at end of file
//
// ** ORDERING IS WRONG FOR OPTIMIZED CODE **
// When I run the --release build, the LED is constantly turned on. HOWEVER,
// if I set breakpoints and pause in the --release build, I can pause it
// just after the LED-turn-off call and the LED turns off, proving that the
// instructions work in release as they do in debug, but that it doesn't wait
// before running the turn-on call as it should.
\ No newline at end of file
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