microwavesafe wrote on Friday, January 13, 2017:
It would be very useful, in my code, to interrogate the size of a Queue in an ISR. Looking at the code I can’t see why this would be a problem. Is the below code a valid implementation?
UBaseType_t uxQueueSpacesAvailableFromISR( const QueueHandle_t xQueue )
{
UBaseType_t uxReturn;
uxReturn = ( ( Queue_t * ) xQueue )->uxLength - ( ( Queue_t * ) xQueue )->uxMessagesWaiting;
return uxReturn;
}
Can anyone see any potential problems with this? Am I missing something obvious?