fork

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
33:341521841d3a
Parent:
28:1c9acd3b224d
Child:
40:8a6494f61326
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pin.c	Sat Feb 06 06:33:56 2016 +0000
@@ -0,0 +1,65 @@
+#include "Global.h"
+
+void PinDiscarg(void)
+{
+    /* unsigned int temp;
+     temp = ((Gyro.Discharg & 0x1)<<4);
+     temp = temp<<4 ;*/
+    Gyro.PinReg |= ((Gyro.Discharg & 0x1)<<4);
+    Gyro.Discharg=Gyro.Discharg>>1;
+}
+
+
+void PinCheng(void)
+{
+    unsigned int vib1, vib2, discarg, Light;
+    unsigned int error;
+    
+    if((Gyro.PinReg & PinRegBitD) != (Gyro.PinRegOld & PinRegBitD)) 
+    
+    {
+        if(Gyro.PinReg & PinRegBitD) LightUpON else LightUpOFF
+     
+    }
+
+   if((Gyro.PinReg & PinRegBitD) != (Gyro.PinRegOld & PinRegBitD)) 
+    
+    {
+        if(Gyro.PinReg & PinRegBitD) LightUpON else LightUpOFF
+      
+    }
+
+  
+  
+    Gyro.PinRegOld = Gyro.PinReg;
+
+
+    if(Gyro.PinReg!=Gyro.PinRegOld)
+
+    {
+        vib1    = Gyro.PinReg & 0x1;
+        vib2    = Gyro.PinReg & 0x2;
+        Light   = Gyro.PinReg & 0x4;
+        discarg = Gyro.PinReg & 0x8;
+
+        if(vib1) {
+            SetV1
+        } else ClrV1
+
+            if(vib2) {
+                SetV2
+            } else ClrV2
+
+                if(Light) {
+                    BackLightON
+                } else {
+                    BackLightOFF
+                }
+
+        if(discarg) {
+            LightUpON
+        } else {
+            LightUpOFF
+        }
+    } else {}
+}
\ No newline at end of file