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 04/28/2006
Status Archive
Type General Article
People Also Viewed