GPIO: GPIO Read function returns 8 bits
authorSandeep Paulraj <s-paulraj@ti.com>
Mon, 12 Sep 2011 20:07:41 +0000 (16:07 -0400)
committerSandeep Paulraj <s-paulraj@ti.com>
Mon, 12 Sep 2011 20:07:41 +0000 (16:07 -0400)
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
src/hw/gpio/gpio.c
src/hw/gpio/gpio.h

index 196ec97c0373b4bad22acef50c51312c2d100f71..f5cecd7de770462e014271079e1427b837785981 100644 (file)
@@ -226,10 +226,13 @@ void hwGpioSetDataBus(Uint8 uchValue)
  * Pre-Condition:      The GPIO[7:0] should be configured as input
  * 
  *****************************************************************************/
-Uint32 hwGpioReadDataBus( void )
+Uint8 hwGpioReadDataBus( void )
 {
+       Uint32 temp;
        Uint32* puchGpioInput = (Uint32*)GPIO_IN_DATA_REG;
-    return *puchGpioInput;
+       temp = *puchGpioInput;
+       temp = temp & 0xff;
+       return ((Uint8)temp);
 }
 
 /******************************************************************************
index fdb8dd50ad9bc563bc37974749e933656362a204..c6fad8da55f9fd0f9957b53e81ffc961a0903ef6 100644 (file)
@@ -125,7 +125,7 @@ void hwGpioSetOutput( Uint32 uiNumber);
 void hwGpioClearOutput( Uint32 uiNumber);
 Uint32 hwGpioReadInput( Uint32 uiNumber );
 void hwGpioWriteDataBus ( Uint8 uchValue );
-Uint32 hwGpioReadDataBus( void );
+Uint8 hwGpioReadDataBus( void );
 void hwGpioEnableGlobalInterrupt( void );
 void hwGpioSetDataBus(Uint8 uchValue);
 void hwGpioClearDataBus(Uint8 uchValue);