XilinxProcessorIPLib/drivers/i2srx/src/xi2srx_debug.c
XI2s_Rx_LogItem* XI2s_Rx_LogRead(XI2s_Rx *InstancePtr)
{
	XI2s_Rx_LogItem* LogPtr = NULL;
	u16 LogBufSize = 0;
	/* Verify whether log is enabled */
	if ((InstancePtr)->Log.IsEnabled == FALSE)
		return NULL;
	/* Verify arguments */
	Xil_AssertNonvoid(InstancePtr != NULL);

	/* Check if there is any data in the log buffer */
	if (InstancePtr->Log.Tail == InstancePtr->Log.Head)
		return NULL;
	LogPtr = &InstancePtr->Log.Items[InstancePtr->Log.Tail];

	/* Increment tail pointer */
	LogBufSize = sizeof(InstancePtr->Log.Items)/sizeof(XI2s_Rx_LogItem);
	if (InstancePtr->Log.Tail == (LogBufSize - 1))
		InstancePtr->Log.Tail = 0;
	else
		InstancePtr->Log.Tail++;
	return LogPtr;
}
/*****************************************************************************/
/**
 * This function returns the next item in the logging buffer.
 * @param InstancePtr is a pointer to the XI2s_Rx instance.
 * @return When the buffer is filled, the next log item is returned.
 * When the buffer is empty, NULL is returned.
 * @note None.
 *****************************************************************************/
This function returns the next item in the logging buffer.
@param InstancePtr is a pointer to the XI2s_Rx instance.
@return When the buffer is filled, the next log item is returned.
When the buffer is empty, NULL is returned.
@note None.
This function returns the next item in the logging buffer . @param InstancePtr is a pointer to the XI2s_Rx instance . @return When the buffer is filled the next log item is returned . When the buffer is empty NULL is returned . @note None .
XI2s_Rx_LogItem* XI2s_Rx_LogRead(XI2s_Rx *InstancePtr)
{
	XI2s_Rx_LogItem* LogPtr = NULL;
	u16 LogBufSize = 0;
	if ((InstancePtr)->Log.IsEnabled == FALSE)
		return NULL;
	Xil_AssertNonvoid(InstancePtr != NULL);
	if (InstancePtr->Log.Tail == InstancePtr->Log.Head)
		return NULL;
	LogPtr = &InstancePtr->Log.Items[InstancePtr->Log.Tail];
	LogBufSize = sizeof(InstancePtr->Log.Items)/sizeof(XI2s_Rx_LogItem);
	if (InstancePtr->Log.Tail == (LogBufSize - 1))
		InstancePtr->Log.Tail = 0;
	else
		InstancePtr->Log.Tail++;
	return LogPtr;
}
XI2s_Rx_LogItem * XI2s_Rx_LogRead ( XI2s_Rx * InstancePtr ) { XI2s_Rx_LogItem * LogPtr = NULL ; u16 LogBufSize = 0 ; if ( ( InstancePtr ) -> Log . IsEnabled == FALSE ) return NULL ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; if ( InstancePtr -> Log . Tail == InstancePtr -> Log . Head ) return NULL ; LogPtr = & InstancePtr -> Log . Items [ InstancePtr -> Log . Tail ] ; LogBufSize = sizeof ( InstancePtr -> Log . Items ) / sizeof ( XI2s_Rx_LogItem ) ; if ( InstancePtr -> Log . Tail == ( LogBufSize - 1 ) ) InstancePtr -> Log . Tail = 0 ; else InstancePtr -> Log . Tail ++ ; return LogPtr ; }
This function returns the next item in the logging buffer.
This function returns the next item in the logging buffer .
/* Verify whether log is enabled */ /* Verify arguments */ /* Check if there is any data in the log buffer */ /* Increment tail pointer */