Skip to content
Snippets Groups Projects
Commit 04b246cb authored by Hauke Petersen's avatar Hauke Petersen
Browse files

cpu/cortexm_common: added cortexm_isr_end() function

parent 9b312a8a
Branches
No related tags found
No related merge requests found
...@@ -32,8 +32,10 @@ ...@@ -32,8 +32,10 @@
#include <stdio.h> #include <stdio.h>
#include "cpu_conf.h"
#include "irq.h" #include "irq.h"
#include "sched.h"
#include "thread.h"
#include "cpu_conf.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -88,6 +90,18 @@ static inline void cpu_sleep_until_event(void) ...@@ -88,6 +90,18 @@ static inline void cpu_sleep_until_event(void)
__WFE(); __WFE();
} }
/**
* @brief Trigger a conditional context scheduler run / context switch
*
* This function is supposed to be called in the end of each ISR.
*/
static inline void cortexm_isr_end(void)
{
if (sched_context_switch_request) {
thread_yield();
}
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment