On running the following code,
#include "xparameters.h"
#include "xgpio.h"
int main(void)
{
XGpio push;
int i,psb_check;
xil_printf("Start");
XGpio_Initialize(&push,XPAR_PUSH_DEVICE_ID);
XGpio_SetDataDirection(&push,1,0xffffffff);
while(1)
{
psb_check=XGpio_DiscreteRead(&push,1);
xil_printf("Status=%x",psb_check);
for(i=0;i<9999999;i++);
}
}
the output constantly shows the value of push button as 31.
What is the reason for this?