Add code to assert() if non ISR safe API function is called from ISR in IAR and GCC CM3 and CM4F ports - Keil and tasking to follow.

This commit is contained in:
Richard Barry 2014-06-14 13:56:25 +00:00
parent 4723209074
commit 113220628f
7 changed files with 62 additions and 5 deletions

View file

@ -379,10 +379,11 @@ void vPortEnterCritical( void )
portENTER_CRITICAL() has been called. */
ulCriticalNesting++;
/* This is not the interrupt safe version of the enter critical function.
Only API functions that end in "FromISR" can be used in an interrupt. The
test of ulCriticalNesting() guards against recursive calls to assert in the
case that assert itself contains a call to taskENTER_CRITICAL. */
/* This is not the interrupt safe version of the enter critical function so
assert() if it is being called from an interrupt context. Only API
functions that end in "FromISR" can be used in an interrupt. Only assert if
the critical nesting count is 1 to protect against recursive calls if the
assert function also uses a critical section. */
if( ulCriticalNesting == 1 )
{
configASSERT( ulPortInterruptNesting == 0 );