/* 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( uxCriticalNesting == 1 )
{
configASSERT( ( portNVIC_INT_CTRL_REG & portVECTACTIVE_MASK ) == 0 );
}
}
The Assert locks us because we are in an ISR.
What is (if there is) the proper way to pass the network buffer back to the stack when an incoming message is received when processing within the ISR?
I’m hoping there is a way as deferring the incoming message to a task is slow.
Thanks Dave – I’m aware of that function BUT … that function would have to be called within a function that the NIC would call … as in a function named xSendEventStructToIPTask_ISR (I made this up as I’m asking if such a function exists).
If the function is called from a task then use xQueueSend() [xQueueSendToBack() is the same].
If the function is called from an ISR then use xQueueSendToBackFromISR().
If the function is called from both a task and an interrupt then it is ok to use xQueueSendToBackFromISR() with due care, but it is not ok to call xQueueSend(). Alternatively, inside the function, check to see if you are in an interrupt or not and call the appropriate queue send version for the context.
No - but its quite a simple function so you could create one. You will
have to use the correct ISR safe API and not do things like print
anything out (as it is in an ISR context) but it should be easy enough.