UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 18068

3.2 EDK - The result of the "XUartLite_mIsIntrEnabled(XPAR_MYUART_BASEADDR)" function is not XTRUE if the interrupt is enabled

Description

Keywords: EDK, 3.2, uartlite, XUartLite_mGetControlReg, read, get

Urgency: Standard

General Description:
The result of the "XUartLite_mIsIntrEnabled(XPAR_MYUART_BASEADDR)" function is not XTRUE if the interrupt is enabled!

The "xuartlite_I.h" includes the following section:

/****************************************************************************/
/**
*
* Check to see if the interrupt is enabled.
*
* @param BaseAddress is the base address of the device
*
* @return XTRUE if the interrupt is enabled, XFALSE otherwise.
*
* @note None.
*
*****************************************************************************/
#define XUartLite_mIsIntrEnabled(BaseAddress) \
(XUartLite_mGetStatusReg((BaseAddress)) & XUL_SR_INTR_ENABLED

however after debugging the following c code

XUartLite_mEnableIntr(XPAR_MYUART_BASEADDR);
test = XUartLite_mIsIntrEnabled(XPAR_MYUART_BASEADDR);
if(XUartLite_mIsIntrEnabled(XPAR_MYUART_BASEADDR)==XTRUE){
:
:
}

test will be 0x10 and the if condition will not get entered because XTRUE = 1

Solution

One work-around is to change the "if" statement from

if(XUartLite_mIsIntrEnabled(XPAR_MYUART_BASEADDR)==XTRUE)

to

if(XUartLite_mIsIntrEnabled(XPAR_MYUART_BASEADDR)==0x10)
AR# 18068
Date Created 09/18/2003
Last Updated 04/28/2006
Status Archive
Type General Article