123
Fork of LG by
Diff: pin.c
- Revision:
- 31:1c9acd3b224d
- Child:
- 33:341521841d3a
diff -r 101340a22746 -r 1c9acd3b224d pin.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pin.c Thu Feb 04 10:21:57 2016 +0000 @@ -0,0 +1,65 @@ +#include "Global.h" + +void PinDiscarg(void) +{ + /* unsigned int temp; + temp = ((Main.Discharg & 0x1)<<4); + temp = temp<<4 ;*/ + Main.PinReg |= ((Main.Discharg & 0x1)<<4); + Main.Discharg=Main.Discharg>>1; +} + + +void PinCheng(void) +{ + unsigned int vib1, vib2, discarg, Light; + unsigned int error; + + if((Main.PinReg & PinRegBitD) != (Main.PinRegOld & PinRegBitD)) + + { + if(Main.PinReg & PinRegBitD) LightUpON else LightUpOFF + + } + + if((Main.PinReg & PinRegBitD) != (Main.PinRegOld & PinRegBitD)) + + { + if(Main.PinReg & PinRegBitD) LightUpON else LightUpOFF + + } + + + + Main.PinRegOld = Main.PinReg; + + + if(Main.PinReg!=Main.PinRegOld) + + { + vib1 = Main.PinReg & 0x1; + vib2 = Main.PinReg & 0x2; + Light = Main.PinReg & 0x4; + discarg = Main.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