File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1897,6 +1897,7 @@ void OSInit (OS_ERR *p_err);
18971897
18981898void OSIntEnter (void );
18991899void OSIntExit (void );
1900+ CPU_BOOLEAN OSIntIsInIsr (void );
19001901
19011902#if (OS_CFG_SCHED_ROUND_ROBIN_EN > 0u )
19021903void OSSchedRoundRobinCfg (CPU_BOOLEAN en ,
Original file line number Diff line number Diff line change @@ -403,6 +403,35 @@ void OSIntExit (void)
403403}
404404
405405
406+ /*
407+ ************************************************************************************************************************
408+ * ISR CHECK
409+ *
410+ * Description: This function is called to check if the current context is in an ISR or not.
411+ *
412+ * Arguments : none
413+ *
414+ * Returns : If current context is in iSR (OS_TRUE) or not (OS_FALSE).
415+ *
416+ * Note(s) : none
417+ ************************************************************************************************************************
418+ */
419+
420+ CPU_BOOLEAN OSIntIsInIsr (void )
421+ {
422+ CPU_BOOLEAN in_isr ;
423+
424+ if (OSIntNestingCtr > 0u ) {
425+ in_isr = OS_TRUE ;
426+ }
427+ else {
428+ in_isr = OS_FALSE ;
429+ }
430+
431+ return (in_isr );
432+ }
433+
434+
406435/*
407436************************************************************************************************************************
408437* INDICATE THAT IT'S NO LONGER SAFE TO CREATE OBJECTS
You can’t perform that action at this time.
0 commit comments