Rev 694 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 694 | Rev 701 | ||
---|---|---|---|
Line 108... | Line 108... | ||
108 | WDTCSR = 0; |
108 | WDTCSR = 0; |
Line 109... | Line 109... | ||
109 | 109 | ||
Line 110... | Line 110... | ||
110 | BeepTime = 2000; |
110 | BeepTime = 2000; |
111 | 111 | ||
112 | PPM_in[CH_GAS] = 0; |
112 | PPM_in[CH_GAS] = 0; |
113 | StickGier = 0; |
113 | StickYaw = 0; |
Line 114... | Line 114... | ||
114 | StickRoll = 0; |
114 | StickRoll = 0; |
Line 115... | Line 115... | ||
115 | StickNick = 0; |
115 | StickPitch = 0; |
116 | 116 | ||
117 | ROT_OFF; |
117 | ROT_OFF; |
118 | 118 | ||
119 | TIMER0_Init(); |
119 | TIMER0_Init(); |
120 | TIMER2_Init(); |
120 | TIMER2_Init(); |
121 | USART0_Init(); |
121 | USART0_Init(); |
122 | USART1_Init(); |
122 | //USART1_Init(); |
123 | rc_sum_init(); |
123 | rc_sum_init(); |
Line 138... | Line 138... | ||
138 | GRN_ON; |
138 | GRN_ON; |
Line 139... | Line 139... | ||
139 | 139 | ||
140 | // Parameter set handling |
140 | // Parameter set handling |
Line 141... | Line 141... | ||
141 | ParamSet_Init(); |
141 | ParamSet_Init(); |
142 | 142 | ||
143 | if(GetParamByte(PID_ACC_NICK) > 4) |
143 | if(GetParamByte(PID_ACC_PITCH) > 4) |
144 | { |
144 | { |
Line 145... | Line 145... | ||
145 | printf("\n\rACC nicht abgeglichen!"); |
145 | printf("\n\rACC nicht abgeglichen!"); |
146 | } |
146 | } |
147 | 147 | ||
Line 148... | Line 148... | ||
148 | //kurze Wartezeit (sonst reagiert die "Kompass kalibrieren?"-Abfrage nicht |
148 | //kurze Wartezeit (sonst reagiert die "Kompass kalibrieren?"-Abfrage nicht |
149 | timer = SetDelay(500); |
149 | timer = SetDelay(500); |
150 | while(!CheckDelay(timer)); |
150 | while(!CheckDelay(timer)); |
151 | 151 | ||
152 | //Compass calibration? |
152 | //Compass calibration? |
153 | if(PPM_in[ParamSet.ChannelAssignment[CH_GAS]] > 100 && PPM_in[ParamSet.ChannelAssignment[CH_GIER]] > 100) |
153 | if(PPM_in[ParamSet.ChannelAssignment[CH_GAS]] > 100 && PPM_in[ParamSet.ChannelAssignment[CH_YAW]] > 100) |
Line 154... | Line 154... | ||
154 | { |
154 | { |
155 | printf("\n\rCalibrating Compass"); |
155 | printf("\n\rCalibrating Compass"); |
156 | MM3_calibrate(); |
156 | MM3_calibrate(); |
157 | } |
157 | } |
158 | 158 | ||
159 | 159 | ||
160 | if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL) |
160 | if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL) |
161 | { |
161 | { |
Line 162... | Line 162... | ||
162 | printf("\n\rAbgleich Luftdrucksensor.."); |
162 | printf("\n\rAbgleich Luftdrucksensor.."); |
Line 198... | Line 198... | ||
198 | else |
198 | else |
199 | { |
199 | { |
200 | DubWiseKeys[0] = 0; |
200 | DubWiseKeys[0] = 0; |
201 | DubWiseKeys[1] = 0; |
201 | DubWiseKeys[1] = 0; |
202 | ExternControl.Config = 0; |
202 | ExternControl.Config = 0; |
203 | ExternStickNick = 0; |
203 | ExternStickPitch= 0; |
204 | ExternStickRoll = 0; |
204 | ExternStickRoll = 0; |
205 | ExternStickGier = 0; |
205 | ExternStickYaw = 0; |
206 | } |
206 | } |
207 | if(SenderOkay) SenderOkay--; |
207 | if(SenderOkay) SenderOkay--; |
208 | if(!I2CTimeout) |
208 | if(!I2CTimeout) |
209 | { |
209 | { |
210 | I2CTimeout = 5; |
210 | I2CTimeout = 5; |
211 | i2c_reset(); |
211 | i2c_reset(); |
212 | if((BeepModulation == 0xFFFF) && MotorenEin) |
212 | if((BeepModulation == 0xFFFF) && MotorsOn) |
213 | { |
213 | { |
214 | BeepTime = 10000; // 1 second |
214 | BeepTime = 10000; // 1 second |
215 | BeepModulation = 0x0080; |
215 | BeepModulation = 0x0080; |
216 | } |
216 | } |
217 | } |
217 | } |