Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
e524d839
Commit
e524d839
authored
3 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
fix(pycardium): Fix potential race when systick counts from 1 to 0
parent
a80eb9a4
No related branches found
Branches containing commit
No related tags found
1 merge request
!475
change(pycardium): Switch systick to 32 kHz clock source
Pipeline
#5252
passed
3 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pycardium/mphalport.c
+3
-0
3 additions, 0 deletions
pycardium/mphalport.c
with
3 additions
and
0 deletions
pycardium/mphalport.c
+
3
−
0
View file @
e524d839
...
...
@@ -166,13 +166,16 @@ void SysTick_Handler(void)
static
uint64_t
systick_get_us
()
{
uint32_t
val
,
count
;
uint32_t
irqsaved
=
__get_PRIMASK
();
/* The asynchronous/slow clocking of the systick means that
* its value can jump to 0 before the interrupt is triggered.
* Simply wait until it is not 0 and then read the count. */
do
{
__set_PRIMASK
(
0
);
val
=
SysTick
->
VAL
;
count
=
systick_count
;
__set_PRIMASK
(
irqsaved
);
}
while
(
val
==
0
);
uint64_t
us
=
count
*
SYSTICK_INTERVAL_US
+
...
...
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