XilinxProcessorIPLib/drivers/i2srx/src/xi2srx_debug.c
void XI2s_Rx_LogWrite(XI2s_Rx *InstancePtr, XI2s_Rx_LogEvt Event, u8 Data)
{
	u16 LogBufSize = 0;

	/* Verify arguments */
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Event < XI2S_RX_LOG_EVT_INVALID);

	if (!InstancePtr->Log.IsEnabled)
		return;
	/* Write data and event into log buffer */
	InstancePtr->Log.Items[InstancePtr->Log.Head].Data = Data;
	InstancePtr->Log.Items[InstancePtr->Log.Head].Event = Event;

	/* Update head pointer */
	LogBufSize = sizeof(InstancePtr->Log.Items)/sizeof(XI2s_Rx_LogItem);
	InstancePtr->Log.Head++;
	if (InstancePtr->Log.Head == LogBufSize)
		InstancePtr->Log.Head = 0;
	/* Check tail pointer. When the two pointer are equal, then the buffer
	 * is full. In this case then increment the tail pointer as well to
	 * remove the oldest entry from the buffer.
	 */
	if (InstancePtr->Log.Tail == InstancePtr->Log.Head) {
		InstancePtr->Log.Tail++;
		if (InstancePtr->Log.Tail == LogBufSize)
			InstancePtr->Log.Tail = 0;
	}
}
/*****************************************************************************/
/**
 *
 * This function writes XI2s Receiver logs into the buffer.
 *
 * @param InstancePtr is a pointer to the XI2s_Rx instance.
 * @param Event is the log event type.
 * @param Data is the log data.
 *
 * @return None.
 *
 * @note Log write is done only if the log is enabled.
 *
 *****************************************************************************/
This function writes XI2s Receiver logs into the buffer.
@param InstancePtr is a pointer to the XI2s_Rx instance.
@param Event is the log event type.
@param Data is the log data.

@return None.

@note Log write is done only if the log is enabled.
This function writes XI2s Receiver logs into the buffer . @param InstancePtr is a pointer to the XI2s_Rx instance . @param Event is the log event type . @param Data is the log data . @return None . @note Log write is done only if the log is enabled .
void XI2s_Rx_LogWrite(XI2s_Rx *InstancePtr, XI2s_Rx_LogEvt Event, u8 Data)
{
	u16 LogBufSize = 0;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Event < XI2S_RX_LOG_EVT_INVALID);
	if (!InstancePtr->Log.IsEnabled)
		return;
	InstancePtr->Log.Items[InstancePtr->Log.Head].Data = Data;
	InstancePtr->Log.Items[InstancePtr->Log.Head].Event = Event;
	LogBufSize = sizeof(InstancePtr->Log.Items)/sizeof(XI2s_Rx_LogItem);
	InstancePtr->Log.Head++;
	if (InstancePtr->Log.Head == LogBufSize)
		InstancePtr->Log.Head = 0;
	if (InstancePtr->Log.Tail == InstancePtr->Log.Head) {
		InstancePtr->Log.Tail++;
		if (InstancePtr->Log.Tail == LogBufSize)
			InstancePtr->Log.Tail = 0;
	}
}
void XI2s_Rx_LogWrite ( XI2s_Rx * InstancePtr , XI2s_Rx_LogEvt Event , u8 Data ) { u16 LogBufSize = 0 ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( Event < XI2S_RX_LOG_EVT_INVALID ) ; if ( ! InstancePtr -> Log . IsEnabled ) return ; InstancePtr -> Log . Items [ InstancePtr -> Log . Head ] . Data = Data ; InstancePtr -> Log . Items [ InstancePtr -> Log . Head ] . Event = Event ; LogBufSize = sizeof ( InstancePtr -> Log . Items ) / sizeof ( XI2s_Rx_LogItem ) ; InstancePtr -> Log . Head ++ ; if ( InstancePtr -> Log . Head == LogBufSize ) InstancePtr -> Log . Head = 0 ; if ( InstancePtr -> Log . Tail == InstancePtr -> Log . Head ) { InstancePtr -> Log . Tail ++ ; if ( InstancePtr -> Log . Tail == LogBufSize ) InstancePtr -> Log . Tail = 0 ; } }
This function writes XI2s Receiver logs into the buffer.
This function writes XI2s Receiver logs into the buffer .
/* Verify arguments */ /* Write data and event into log buffer */ /* Update head pointer */ /* Check tail pointer. When the two pointer are equal, then the buffer
	 * is full. In this case then increment the tail pointer as well to
	 * remove the oldest entry from the buffer.
	 */