Default the definition of portASSERT_IF_IN_ISR() to nothing if it is not defined.

Helper updates to allow a count of the number of mutexes held to be added.
Updates to the CCS Cortex-R4 implementation necessitated by a change in compiler semantics.
Update PIC32MX and MZ ports to assert if a non ISR safe function is called from an ISR.
This commit is contained in:
Richard Barry 2014-06-16 12:51:35 +00:00
parent b4659d8872
commit 583b144bc3
7 changed files with 79 additions and 26 deletions

View file

@ -315,6 +315,16 @@ void vPortEnterCritical( void )
directly. Increment ulCriticalNesting to keep a count of how many times
portENTER_CRITICAL() has been called. */
ulCriticalNesting++;
/* 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 );
}
}
/*-----------------------------------------------------------*/