Rev 1142 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1142 | Rev 1157 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | J17Mask = 128; |
40 | J17Mask = 128; |
41 | } |
41 | } |
Line 42... | Line 42... | ||
42 | 42 | ||
Line 43... | Line 43... | ||
43 | static inline void checkLightsEnabled(void) { |
43 | static inline void checkLightsEnabled(void) { |
- | 44 | ||
44 | 45 | // Die LED's können mit den Motoren ein- ausgeschaltet werden |
|
- | 46 | if (PARAM_LED_ENGINE_ENABLED) |
|
45 | // Mit dem Gier-Stick rechts lassen sich bei stehenden Motoren die LED's ein- und mit links ausschalten |
47 | lightsEnabled = MotorenEin; |
- | 48 | // Die LED's können mit den Motoren ein- ausgeschaltet werden |
|
46 | if (!MotorenEin) { |
49 | else if (PARAM_LED_STICK_ENABLED) { |
47 | if (PARAM_LED_STICK_ENABLED) { |
50 | if (!MotorenEin) { |
48 | if (PPM_in[ EE_Parameter.Kanalbelegung[ K_GAS ] ] > 35 - 120 |
51 | if (PPM_in[ EE_Parameter.Kanalbelegung[ K_GAS ] ] > 35 - 120 |
49 | && PPM_in[ EE_Parameter.Kanalbelegung[ K_GAS ] ] < 120 - 35) { |
52 | && PPM_in[ EE_Parameter.Kanalbelegung[ K_GAS ] ] < 120 - 35) { |
50 | if (PPM_in[ EE_Parameter.Kanalbelegung[ K_GIER ] ] < -75) |
53 | if (PPM_in[ EE_Parameter.Kanalbelegung[ K_GIER ] ] < -75) |
51 | lightsEnabled = 1; |
54 | lightsEnabled = 1; |
52 | if (PPM_in[ EE_Parameter.Kanalbelegung[ K_GIER ] ] > 75) |
55 | if (PPM_in[ EE_Parameter.Kanalbelegung[ K_GIER ] ] > 75) |
53 | lightsEnabled = 0; |
56 | lightsEnabled = 0; |
54 | } |
- | |
55 | } else |
57 | } |
56 | lightsEnabled = 1; |
- | |
57 | } |
- | |
58 | - | ||
59 | // Die LED's können mit den Motoren ein- ausgeschaltet werden |
58 | } |
Line 60... | Line 59... | ||
60 | if (PARAM_LED_ENGINE_ENABLED) |
59 | } else |
61 | lightsEnabled = MotorenEin; |
60 | lightsEnabled = 1; |
Line 62... | Line 61... | ||
62 | 61 | ||
Line 63... | Line 62... | ||
63 | lightsOn = lightsEnabled; |
62 | lightsOn = lightsEnabled; |
Line 64... | Line 63... | ||
64 | } |
63 | } |
Line 65... | Line -... | ||
65 | - | ||
66 | // called in UpdateMotors() every 2ms |
- | |
67 | 64 | ||
Line 68... | Line 65... | ||
68 | void LED_Update(void) { |
65 | // called in UpdateMotors() every 2ms |
Line -... | Line 66... | ||
- | 66 | ||
- | 67 | void LED_Update(void) { |
|
69 | 68 | ||
70 | static char delay = 0; |
69 | static char delay = 0; |
71 | 70 | ||
72 | checkLightsEnabled(); |
71 | if (!delay--) { |
73 | 72 | ||
Line 91... | Line 90... | ||
91 | else if (!J16Blinkcount--) { |
90 | else if (!J16Blinkcount--) { |
92 | J16Blinkcount = Parameter_J16Timing - 1; |
91 | J16Blinkcount = Parameter_J16Timing - 1; |
93 | J16Mask = (J16Mask == 1 ? 0x80 : J16Mask >> 1); |
92 | J16Mask = (J16Mask == 1 ? 0x80 : J16Mask >> 1); |
Line 94... | Line 93... | ||
94 | 93 | ||
95 | J16 = EE_Parameter.J16Bitmask & J16Mask; |
- | |
96 | - | ||
97 | if (EE_Parameter.J16Bitmask & J16Mask) |
- | |
98 | J16Brightness = Parameter_J16Brightness / 23; |
- | |
99 | else |
- | |
100 | J16Brightness = 0; |
94 | J16 = EE_Parameter.J16Bitmask & J16Mask; |
Line -... | Line 95... | ||
- | 95 | } |
|
- | 96 | ||
101 | } |
97 | J16Brightness = EE_Parameter.J16Bitmask & J16Mask ? Parameter_J16Brightness / 23 : 0; |
102 | 98 | ||
103 | // J17 |
99 | // J17 |
104 | if (EE_Parameter.J17Timing > 250 && Parameter_J17Timing > 230) |
100 | if (EE_Parameter.J17Timing > 250 && Parameter_J17Timing > 230) |
105 | J17 = EE_Parameter.J17Bitmask & 128; |
101 | J17 = EE_Parameter.J17Bitmask & 128; |
106 | else if (EE_Parameter.J17Timing > 250 && Parameter_J17Timing < 10) |
102 | else if (EE_Parameter.J17Timing > 250 && Parameter_J17Timing < 10) |
107 | J17 = !(EE_Parameter.J17Bitmask & 128); |
103 | J17 = !(EE_Parameter.J17Bitmask & 128); |
108 | else if (!J17Blinkcount--) { |
104 | else if (!J17Blinkcount--) { |
Line 109... | Line 105... | ||
109 | J17Blinkcount = Parameter_J17Timing - 1; |
105 | J17Blinkcount = Parameter_J17Timing - 1; |
110 | J17Mask = (J17Mask == 1 ? 0x80 : J17Mask >> 1); |
- | |
111 | - | ||
112 | J17 = EE_Parameter.J17Bitmask & J17Mask; |
- | |
113 | - | ||
114 | if (EE_Parameter.J17Bitmask & J17Mask) |
- | |
115 | J17Brightness = Parameter_J17Brightness / 23; |
106 | J17Mask = (J17Mask == 1 ? 0x80 : J17Mask >> 1); |
- | 107 | ||
- | 108 | J17 = EE_Parameter.J17Bitmask & J17Mask; |
|
116 | else |
109 | } |
Line 117... | Line 110... | ||
117 | J17Brightness = 0; |
110 | |
118 | } |
111 | J17Brightness = EE_Parameter.J17Bitmask & J17Mask ? Parameter_J17Brightness / 23 : 0; |
119 | } |
112 | } |