![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
pin.c@33:341521841d3a, 2016-02-06 (annotated)
- Committer:
- igor_v
- Date:
- Sat Feb 06 06:33:56 2016 +0000
- Revision:
- 33:341521841d3a
- Parent:
- 28:1c9acd3b224d
- Child:
- 40:8a6494f61326
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kovalev_D | 28:1c9acd3b224d | 1 | #include "Global.h" |
Kovalev_D | 28:1c9acd3b224d | 2 | |
Kovalev_D | 28:1c9acd3b224d | 3 | void PinDiscarg(void) |
Kovalev_D | 28:1c9acd3b224d | 4 | { |
Kovalev_D | 28:1c9acd3b224d | 5 | /* unsigned int temp; |
igor_v | 33:341521841d3a | 6 | temp = ((Gyro.Discharg & 0x1)<<4); |
Kovalev_D | 28:1c9acd3b224d | 7 | temp = temp<<4 ;*/ |
igor_v | 33:341521841d3a | 8 | Gyro.PinReg |= ((Gyro.Discharg & 0x1)<<4); |
igor_v | 33:341521841d3a | 9 | Gyro.Discharg=Gyro.Discharg>>1; |
Kovalev_D | 28:1c9acd3b224d | 10 | } |
Kovalev_D | 28:1c9acd3b224d | 11 | |
Kovalev_D | 28:1c9acd3b224d | 12 | |
Kovalev_D | 28:1c9acd3b224d | 13 | void PinCheng(void) |
Kovalev_D | 28:1c9acd3b224d | 14 | { |
Kovalev_D | 28:1c9acd3b224d | 15 | unsigned int vib1, vib2, discarg, Light; |
Kovalev_D | 28:1c9acd3b224d | 16 | unsigned int error; |
Kovalev_D | 28:1c9acd3b224d | 17 | |
igor_v | 33:341521841d3a | 18 | if((Gyro.PinReg & PinRegBitD) != (Gyro.PinRegOld & PinRegBitD)) |
Kovalev_D | 28:1c9acd3b224d | 19 | |
Kovalev_D | 28:1c9acd3b224d | 20 | { |
igor_v | 33:341521841d3a | 21 | if(Gyro.PinReg & PinRegBitD) LightUpON else LightUpOFF |
Kovalev_D | 28:1c9acd3b224d | 22 | |
Kovalev_D | 28:1c9acd3b224d | 23 | } |
Kovalev_D | 28:1c9acd3b224d | 24 | |
igor_v | 33:341521841d3a | 25 | if((Gyro.PinReg & PinRegBitD) != (Gyro.PinRegOld & PinRegBitD)) |
Kovalev_D | 28:1c9acd3b224d | 26 | |
Kovalev_D | 28:1c9acd3b224d | 27 | { |
igor_v | 33:341521841d3a | 28 | if(Gyro.PinReg & PinRegBitD) LightUpON else LightUpOFF |
Kovalev_D | 28:1c9acd3b224d | 29 | |
Kovalev_D | 28:1c9acd3b224d | 30 | } |
Kovalev_D | 28:1c9acd3b224d | 31 | |
Kovalev_D | 28:1c9acd3b224d | 32 | |
Kovalev_D | 28:1c9acd3b224d | 33 | |
igor_v | 33:341521841d3a | 34 | Gyro.PinRegOld = Gyro.PinReg; |
Kovalev_D | 28:1c9acd3b224d | 35 | |
Kovalev_D | 28:1c9acd3b224d | 36 | |
igor_v | 33:341521841d3a | 37 | if(Gyro.PinReg!=Gyro.PinRegOld) |
Kovalev_D | 28:1c9acd3b224d | 38 | |
Kovalev_D | 28:1c9acd3b224d | 39 | { |
igor_v | 33:341521841d3a | 40 | vib1 = Gyro.PinReg & 0x1; |
igor_v | 33:341521841d3a | 41 | vib2 = Gyro.PinReg & 0x2; |
igor_v | 33:341521841d3a | 42 | Light = Gyro.PinReg & 0x4; |
igor_v | 33:341521841d3a | 43 | discarg = Gyro.PinReg & 0x8; |
Kovalev_D | 28:1c9acd3b224d | 44 | |
Kovalev_D | 28:1c9acd3b224d | 45 | if(vib1) { |
Kovalev_D | 28:1c9acd3b224d | 46 | SetV1 |
Kovalev_D | 28:1c9acd3b224d | 47 | } else ClrV1 |
Kovalev_D | 28:1c9acd3b224d | 48 | |
Kovalev_D | 28:1c9acd3b224d | 49 | if(vib2) { |
Kovalev_D | 28:1c9acd3b224d | 50 | SetV2 |
Kovalev_D | 28:1c9acd3b224d | 51 | } else ClrV2 |
Kovalev_D | 28:1c9acd3b224d | 52 | |
Kovalev_D | 28:1c9acd3b224d | 53 | if(Light) { |
Kovalev_D | 28:1c9acd3b224d | 54 | BackLightON |
Kovalev_D | 28:1c9acd3b224d | 55 | } else { |
Kovalev_D | 28:1c9acd3b224d | 56 | BackLightOFF |
Kovalev_D | 28:1c9acd3b224d | 57 | } |
Kovalev_D | 28:1c9acd3b224d | 58 | |
Kovalev_D | 28:1c9acd3b224d | 59 | if(discarg) { |
Kovalev_D | 28:1c9acd3b224d | 60 | LightUpON |
Kovalev_D | 28:1c9acd3b224d | 61 | } else { |
Kovalev_D | 28:1c9acd3b224d | 62 | LightUpOFF |
Kovalev_D | 28:1c9acd3b224d | 63 | } |
Kovalev_D | 28:1c9acd3b224d | 64 | } else {} |
Kovalev_D | 28:1c9acd3b224d | 65 | } |