import
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#ifndef INCLUDED_OS_ISR_H
|
||||
#define INCLUDED_OS_ISR_H
|
||||
|
||||
#ifndef INCLUDED_OS_TYPES_H
|
||||
#include <os_types.h>
|
||||
#endif /*INCLUDED_OS_TYPES_H*/
|
||||
|
||||
#ifndef INCLUDED_OS_COMPILER_H
|
||||
#include <os_compiler.h>
|
||||
#endif /*INCLUDED_OS_COMPILER_H*/
|
||||
|
||||
#ifndef INCLUDED_OS_CRITICAL_H
|
||||
#include <os_critical.h>
|
||||
#endif /*INCLUDED_OS_CRITICAL_H*/
|
||||
|
||||
#ifndef INCLUDED_OS_SCHED_H
|
||||
#include <os_sched.h>
|
||||
#endif /*INCLUDED_OS_SCHED_H*/
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------ */
|
||||
/* */
|
||||
|
||||
extern volatile os_size_t g_os_isr_nesting_cnt;
|
||||
|
||||
|
||||
OS_STATIC_FORCE_INLINE
|
||||
void os_isr_enter(void){
|
||||
os_critical_enter_in_isr();
|
||||
g_os_isr_nesting_cnt++;
|
||||
os_critical_leave_in_isr();
|
||||
}
|
||||
|
||||
OS_STATIC_FORCE_INLINE
|
||||
void os_isr_leave(void){
|
||||
os_critical_enter_in_isr();
|
||||
g_os_isr_nesting_cnt--;
|
||||
if(g_os_isr_nesting_cnt==0){
|
||||
if(g_os_sched_pending_cnt>0){
|
||||
g_os_sched_pending_cnt = 0;
|
||||
os_critical_leave_in_isr();
|
||||
os_sched_in_isr();
|
||||
return;
|
||||
}
|
||||
}
|
||||
os_critical_leave_in_isr();
|
||||
}
|
||||
|
||||
|
||||
#endif /*INCLUDED_OS_ISR_H*/
|
||||
Reference in New Issue
Block a user