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
bc4c4fb5
Commit
bc4c4fb5
authored
Sep 16, 2021
by
schneider
Browse files
feat(sleep): Tell the caller of epic_sleep() if an interrupt happened
parent
6204cdc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
epicardium/drivers/sleep.c
View file @
bc4c4fb5
...
...
@@ -15,6 +15,7 @@
#include
"mxc_pins.h"
#include
<stdint.h>
#include
<limits.h>
/* Most code is taken and adapted rom EvKitExamples/LP/main.c */
...
...
@@ -208,9 +209,15 @@ void sleep_deepsleep(void)
MAX77650_setEN_SBB2
(
0
b110
);
}
void
epic_sleep
(
uint32_t
ms
)
int
epic_sleep
(
uint32_t
ms
)
{
/* Allow the interrupt module to break us out of a call to
* epic_sleep() */
ulTaskNotifyTake
(
pdTRUE
,
pdMS_TO_TICKS
(
ms
));
uint32_t
count
=
ulTaskNotifyTake
(
pdTRUE
,
pdMS_TO_TICKS
(
ms
));
if
(
count
==
0
)
{
return
0
;
}
else
{
return
INT_MAX
;
}
}
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