]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Merged in from mpc551x_mcal
authortojo <tobias.johansson@arccore.com>
Fri, 25 Feb 2011 14:16:02 +0000 (15:16 +0100)
committertojo <tobias.johansson@arccore.com>
Fri, 25 Feb 2011 14:16:02 +0000 (15:16 +0100)
1  2 
arch/ppc/mpc55xx/drivers/Dio.c

index 96b7e2d8dd3d06b5d387fd7461319d744a179531,ab437be466e85abbec089c4d9c2bebf47ea7de48..5be0cbfdf8783c3413fe7f1d34968a793d52a28e
@@@ -105,35 -105,31 +105,40 @@@ static int Channel_Group_Config_Contain
  \r
  Dio_LevelType Dio_ReadChannel(Dio_ChannelType channelId)\r
  {\r
-   Dio_LevelType level = STD_LOW;\r
+   Dio_LevelType level;\r
    VALIDATE_CHANNEL(channelId, DIO_READCHANNEL_ID);\r
 -  // Read level from SIU.\r
 -  if (SIU.GPDI [channelId].R)\r
 -  {\r
 -    level = STD_HIGH;\r
 -  } else\r
 -  {\r
 -    level = STD_LOW;\r
 +  if (SIU.PCR[channelId].B.IBE) {\r
 +    // Read level from SIU.\r
 +    if (SIU.GPDI [channelId].R) {\r
 +      level = STD_HIGH;\r
 +    } else {\r
 +      level = STD_LOW;\r
 +    }\r
 +  } else if(SIU.PCR[channelId].B.OBE) {\r
 +    // Read level from SIU.\r
 +    if (SIU.GPDO [channelId].R) {\r
 +      level = STD_HIGH;\r
 +    } else {\r
 +      level = STD_LOW;\r
 +    }\r
    }\r
\r
-   cleanup: return (level);\r
+ #if ( DIO_DEV_ERROR_DETECT == STD_ON )\r
+   cleanup:\r
+ #endif\r
+   return (level);\r
  }\r
  \r
  void Dio_WriteChannel(Dio_ChannelType channelId, Dio_LevelType level)\r
  {\r
    VALIDATE_CHANNEL(channelId, DIO_WRITECHANNEL_ID);\r
    // Write level to SIU.\r
 -  SIU.GPDO [channelId].R = level;\r
 +  if(SIU.PCR[channelId].B.OBE) {\r
 +    SIU.GPDO [channelId].R = level;\r
 +  }\r
-   cleanup: return;\r
+ #if ( DIO_DEV_ERROR_DETECT == STD_ON )\r
+   cleanup:\r
+ #endif\r
+   return;\r
  }\r
  \r
  Dio_PortLevelType Dio_ReadPort(Dio_PortType portId)\r