Public Functions When no data is available in the TMALI queue this routine blocks on a semaphore awaiting availability of events on the TMALI queue as indicated by the ISR.  When data is already available on the TMALI queue, or the semaphore is taken, the number of events on the TMALI queue is determined and returned to the caller.  The parameter ‘TickstoWait’ specifies the maximum time which the function can wait until data becomes available in kernel-ticks.  The parameter may be set to a symbolic value ‘FOREVER’ which causes the function only to return when data is available.  When the function is called with a timeout value and no data becomes avialable within that period the function will return zero (events available).If the tmali task has not been initialized the function returns an error.