Rev 1153 | Rev 1156 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1153 | Rev 1155 | ||
---|---|---|---|
Line 165... | Line 165... | ||
165 | printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR,VERSION_PATCH + 'a'); |
165 | printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR,VERSION_PATCH + 'a'); |
166 | printf("\n\r=============================="); |
166 | printf("\n\r=============================="); |
Line 167... | Line 167... | ||
167 | 167 | ||
Line 168... | Line -... | ||
168 | GRN_ON; |
- | |
169 | 168 | GRN_ON; |
|
170 | 169 | ||
171 | ReadParameterSet(3, (unsigned char *) &EE_Parameter.Kanalbelegung[0], 9); // read only the first bytes |
170 | ReadParameterSet(3, (unsigned char *) &EE_Parameter.Kanalbelegung[0], 9); // read only the first bytes |
172 | // valid Stick-Settings? |
171 | // valid Stick-Settings? |
173 | if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) == 255 || eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) < EE_DATENREVISION || |
172 | if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) == 255 || eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) < EE_DATENREVISION || |
174 | EE_Parameter.Kanalbelegung[0] > 9 || EE_Parameter.Kanalbelegung[1] > 9 || EE_Parameter.Kanalbelegung[2] > 9 || EE_Parameter.Kanalbelegung[3] > 9) |
173 | EE_Parameter.Kanalbelegung[0] > 9 || EE_Parameter.Kanalbelegung[1] > 9 || EE_Parameter.Kanalbelegung[2] > 9 || EE_Parameter.Kanalbelegung[3] > 9) |
175 | { |
174 | { |
176 | printf("\n\rInit. EEPROM: Generating Default-Parameter and Stick-Settings..."); |
175 | printf("\n\rInit. EEPROM"); |
177 | DefaultStickMapping(); |
176 | DefaultStickMapping(); |
Line 178... | Line 177... | ||
178 | } |
177 | } |
Line 236... | Line 235... | ||
236 | LcdClear(); |
235 | LcdClear(); |
237 | I2CTimeout = 5000; |
236 | I2CTimeout = 5000; |
238 | WinkelOut.Orientation = 1; |
237 | WinkelOut.Orientation = 1; |
239 | while (1) |
238 | while (1) |
240 | { |
239 | { |
241 | - | ||
242 | if(UpdateMotor) // ReglerIntervall |
240 | if(UpdateMotor && AdReady) // ReglerIntervall |
243 | { |
241 | { |
244 | //PORTD |= 0x08; |
242 | J3High; |
245 | UpdateMotor=0; |
243 | UpdateMotor=0; |
246 | if(WinkelOut.CalcState) CalMk3Mag(); |
244 | if(WinkelOut.CalcState) CalMk3Mag(); |
247 | else MotorRegler(); |
245 | else MotorRegler(); |
248 | SendMotorData(); |
246 | SendMotorData(); |
249 | ROT_OFF; |
247 | ROT_OFF; |
- | 248 | J3Low; |
|
250 | if(PcZugriff) PcZugriff--; |
249 | if(PcZugriff) PcZugriff--; |
251 | else |
250 | else |
252 | { |
251 | { |
253 | ExternControl.Config = 0; |
252 | ExternControl.Config = 0; |
254 | ExternStickNick = 0; |
253 | ExternStickNick = 0; |
Line 291... | Line 290... | ||
291 | 290 | ||
292 | SendSPI = 4; |
291 | SendSPI = 4; |
293 | timer = SetDelay(20); |
292 | timer = SetDelay(20); |
294 | } |
293 | } |
295 | LED_Update(); |
- | |
296 | //PORTD &= ~0x08; |
294 | LED_Update(); |
297 | } |
295 | } |
298 | if(!SendSPI) { SPI_TransmitByte(); } |
296 | if(!SendSPI) { SPI_TransmitByte(); } |
299 | } |
297 | } |
300 | return (1); |
298 | return (1); |