XilinxProcessorIPLib/drivers/v_hdmirxss/src/xv_hdmirxss_log.c
void XV_HdmiRxSs_LogWrite(XV_HdmiRxSs *InstancePtr, XV_HdmiRxSs_LogEvent Evt, u8 Data)
{
    /* Verify arguments. */
    Xil_AssertVoid(InstancePtr != NULL);
    Xil_AssertVoid(Evt <= (XV_HDMIRXSS_LOG_EVT_DUMMY));
    Xil_AssertVoid(Data < 0xFF);

    /* Write data and event into log buffer */
    InstancePtr->Log.DataBuffer[InstancePtr->Log.HeadIndex] =
            (Data << 8) | Evt;

	/* Update head pointer if reached to end of the buffer */
	if (InstancePtr->Log.HeadIndex ==
			(u8)((sizeof(InstancePtr->Log.DataBuffer) /
					sizeof(InstancePtr->Log.DataBuffer[0])) - 1)) {
		/* Clear pointer */
		InstancePtr->Log.HeadIndex = 0;
	}
	else {
		/* Increment pointer */
		InstancePtr->Log.HeadIndex++;
	}

	/* 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.TailIndex == InstancePtr->Log.HeadIndex) {
		if (InstancePtr->Log.TailIndex ==
			(u8)((sizeof(InstancePtr->Log.DataBuffer) /
					sizeof(InstancePtr->Log.DataBuffer[0])) - 1)) {
			InstancePtr->Log.TailIndex = 0;
		}
		else {
			InstancePtr->Log.TailIndex++;
		}
	}
}
/*****************************************************************************/
/**
* This function will insert an event in the driver's logginc mechanism.
*
* @param    InstancePtr is a pointer to the XV_HdmiRxSs core instance.
* @param    Evt is the event type to log.
* @param    Data is the associated data for the event.
*
* @return   None.
*
* @note     None.
*
******************************************************************************/
This function will insert an event in the driver's logginc mechanism.
This function will insert an event in the driver ' s logginc mechanism .
void XV_HdmiRxSs_LogWrite(XV_HdmiRxSs *InstancePtr, XV_HdmiRxSs_LogEvent Evt, u8 Data)
{
    Xil_AssertVoid(InstancePtr != NULL);
    Xil_AssertVoid(Evt <= (XV_HDMIRXSS_LOG_EVT_DUMMY));
    Xil_AssertVoid(Data < 0xFF);
    InstancePtr->Log.DataBuffer[InstancePtr->Log.HeadIndex] =
            (Data << 8) | Evt;
	if (InstancePtr->Log.HeadIndex ==
			(u8)((sizeof(InstancePtr->Log.DataBuffer) /
					sizeof(InstancePtr->Log.DataBuffer[0])) - 1)) {
		InstancePtr->Log.HeadIndex = 0;
	}
	else {
		InstancePtr->Log.HeadIndex++;
	}
	if (InstancePtr->Log.TailIndex == InstancePtr->Log.HeadIndex) {
		if (InstancePtr->Log.TailIndex ==
			(u8)((sizeof(InstancePtr->Log.DataBuffer) /
					sizeof(InstancePtr->Log.DataBuffer[0])) - 1)) {
			InstancePtr->Log.TailIndex = 0;
		}
		else {
			InstancePtr->Log.TailIndex++;
		}
	}
}
void XV_HdmiRxSs_LogWrite ( XV_HdmiRxSs * InstancePtr , XV_HdmiRxSs_LogEvent Evt , u8 Data ) { Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( Evt <= ( XV_HDMIRXSS_LOG_EVT_DUMMY ) ) ; Xil_AssertVoid ( Data < 0xFF ) ; InstancePtr -> Log . DataBuffer [ InstancePtr -> Log . HeadIndex ] = ( Data << 8 ) | Evt ; if ( InstancePtr -> Log . HeadIndex == ( u8 ) ( ( sizeof ( InstancePtr -> Log . DataBuffer ) / sizeof ( InstancePtr -> Log . DataBuffer [ 0 ] ) ) - 1 ) ) { InstancePtr -> Log . HeadIndex = 0 ; } else { InstancePtr -> Log . HeadIndex ++ ; } if ( InstancePtr -> Log . TailIndex == InstancePtr -> Log . HeadIndex ) { if ( InstancePtr -> Log . TailIndex == ( u8 ) ( ( sizeof ( InstancePtr -> Log . DataBuffer ) / sizeof ( InstancePtr -> Log . DataBuffer [ 0 ] ) ) - 1 ) ) { InstancePtr -> Log . TailIndex = 0 ; } else { InstancePtr -> Log . TailIndex ++ ; } } }
This function will insert an event in the driver's logginc mechanism.
This function will insert an event in the driver ' s logginc mechanism .
/* Verify arguments. */ /* Write data and event into log buffer */ /* Update head pointer if reached to end of the buffer */ /* Clear pointer */ /* Increment 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. */