Rev 805 | Rev 823 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 805 | Rev 819 | ||
---|---|---|---|
Line 82... | Line 82... | ||
82 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
82 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
83 | } |
83 | } |
84 | return(set); |
84 | return(set); |
85 | } |
85 | } |
Line -... | Line 86... | ||
- | 86 | ||
- | 87 | void CalMk3Mag(void) |
|
- | 88 | { |
|
- | 89 | static unsigned char stick = 1; |
|
- | 90 | ||
- | 91 | if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > -20) stick = 0; |
|
- | 92 | if((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -70) && !stick) |
|
- | 93 | { |
|
- | 94 | stick = 1; |
|
- | 95 | WinkelOut.CalcState++; |
|
- | 96 | if(WinkelOut.CalcState > 4) |
|
- | 97 | { |
|
- | 98 | // WinkelOut.CalcState = 0; // in Uart.c |
|
- | 99 | beeptime = 1000; |
|
- | 100 | } |
|
- | 101 | else Piep(WinkelOut.CalcState); |
|
- | 102 | } |
|
- | 103 | DebugOut.Analog[19] = WinkelOut.CalcState; |
|
- | 104 | } |
|
- | 105 | ||
86 | 106 | ||
87 | //############################################################################ |
107 | //############################################################################ |
88 | //Hauptprogramm |
108 | //Hauptprogramm |
89 | int main (void) |
109 | int main (void) |
90 | //############################################################################ |
110 | //############################################################################ |
91 | { |
111 | { |
Line 92... | Line 112... | ||
92 | unsigned int timer, alt_ms; |
112 | unsigned int timer; |
93 | 113 | ||
94 | //unsigned int timer2 = 0; |
114 | //unsigned int timer2 = 0; |
95 | DDRB = 0x00; |
115 | DDRB = 0x00; |
Line 181... | Line 201... | ||
181 | 201 | ||
Line 182... | Line 202... | ||
182 | printf("\n\n\r"); |
202 | printf("\n\n\r"); |
183 | 203 | ||
- | 204 | LcdClear(); |
|
184 | LcdClear(); |
205 | I2CTimeout = 5000; |
185 | I2CTimeout = 5000; |
206 | WinkelOut.Orientation = 1; |
Line 186... | Line 207... | ||
186 | while (1) |
207 | while (1) |
187 | { |
208 | { |
188 | 209 | ||
189 | if(UpdateMotor) // ReglerIntervall |
210 | if(UpdateMotor) // ReglerIntervall |
- | 211 | { |
|
190 | { |
212 | UpdateMotor=0; |
191 | UpdateMotor=0; |
213 | //PORTD |= 0x08; |
192 | //PORTD |= 0x08; |
214 | if(WinkelOut.CalcState) CalMk3Mag(); |
193 | MotorRegler(); |
215 | else MotorRegler(); |
194 | //PORTD &= ~0x08; |
216 | //PORTD &= ~0x08; |
195 | SendMotorData(); |
217 | SendMotorData(); |