Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
card10
firmware
Commits
c9a840d2
Commit
c9a840d2
authored
Sep 15, 2021
by
schneider
Browse files
change(pycardium): Scale calls to epic_sleep based on systick interval
parent
08258739
Changes
1
Hide whitespace changes
Inline
Side-by-side
pycardium/mphalport.c
View file @
c9a840d2
...
...
@@ -246,9 +246,18 @@ static void systick_delay(uint32_t us)
while
(
final_time
-
systick_get_us
()
>
SYSTICK_INTERVAL_US
)
{
uint32_t
sleep_time
=
(
final_time
-
systick_get_us
())
/
1000
;
if
(
sleep_time
>
100
)
sleep_time
=
100
;
/* We need to wake up at least in SYSTICK_INTERVAL_US to make
* sure we serve the systick interrupt.
* Add some error margin to avoid issues with the clock accuracy
* of epicardium */
if
(
sleep_time
>
SYSTICK_INTERVAL_US
/
1000
/
2
)
{
sleep_time
=
SYSTICK_INTERVAL_US
/
1000
/
2
;
}
epic_sleep
(
sleep_time
);
/* epic_sleep() can return early if there was an interrupt
* coming from epicardium side.
* Give MP a chance to handle them. */
mp_handle_pending
(
true
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment