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?
UBaseTypet uxQueueSpacesAvailableFromISR( const QueueHandlet xQueue ) { UBaseTypet uxReturn; uxReturn = ( ( Queuet * ) xQueue )->uxLength - ( ( Queue_t * ) xQueue )->uxMessagesWaiting; return uxReturn; }
Can anyone see any potential problems with this? Am I missing something obvious?
You can call uxQueueMessagesWaitingFromISR()