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
374ca0bb
Commit
374ca0bb
authored
3 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
feat(sleep): Allow the interrupt module to break epic_sleep
parent
c4fe452c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!480
Pycardium: Use sleep API call while sleeping
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/drivers/sleep.c
+3
-1
3 additions, 1 deletion
epicardium/drivers/sleep.c
epicardium/user_core/interrupts.c
+9
-0
9 additions, 0 deletions
epicardium/user_core/interrupts.c
with
12 additions
and
1 deletion
epicardium/drivers/sleep.c
+
3
−
1
View file @
374ca0bb
...
...
@@ -210,5 +210,7 @@ void sleep_deepsleep(void)
void
epic_sleep
(
uint32_t
ms
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
ms
));
/* Allow the interrupt module to break us out of a call to
* epic_sleep() */
ulTaskNotifyTake
(
pdTRUE
,
pdMS_TO_TICKS
(
ms
));
}
This diff is collapsed.
Click to expand it.
epicardium/user_core/interrupts.c
+
9
−
0
View file @
374ca0bb
...
...
@@ -2,6 +2,7 @@
#include
"os/core.h"
#include
"epicardium.h"
#include
"api/interrupt-sender.h"
#include
"user_core/user_core.h"
#include
<assert.h>
struct
interrupt_priv
{
...
...
@@ -45,6 +46,10 @@ void interrupt_trigger_sync(api_int_id_t id)
;
api_interrupt_trigger
(
id
);
/* Break the dispatcher task out of a potential call
* to epic_sleep() */
xTaskNotifyGive
(
dispatcher_task_id
);
out:
mutex_unlock
(
&
interrupt_mutex
);
}
...
...
@@ -171,6 +176,10 @@ void vInterruptsTask(void *pvParameters)
interrupt_data
.
has_pending
=
false
;
}
else
if
(
interrupt_data
.
int_enabled
[
current_irq
])
{
api_interrupt_trigger
(
current_irq
);
/* Break the dispatcher task out of a potential call
* to epic_sleep() */
xTaskNotifyGive
(
dispatcher_task_id
);
}
mutex_unlock
(
&
interrupt_mutex
);
...
...
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