Rev 296 | Rev 395 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 296 | Rev 304 | ||
---|---|---|---|
Line 91... | Line 91... | ||
91 | int main (void) |
91 | int main (void) |
92 | //############################################################################ |
92 | //############################################################################ |
93 | { |
93 | { |
94 | unsigned int timer; |
94 | unsigned int timer; |
Line 95... | Line 95... | ||
95 | 95 | ||
96 | unsigned int timer2 = 0; |
96 | //unsigned int timer2 = 0; |
97 | DDRB = 0x00; |
97 | DDRB = 0x00; |
98 | PORTB = 0x00; |
98 | PORTB = 0x00; |
99 | for(timer = 0; timer < 1000; timer++); // verzögern |
99 | for(timer = 0; timer < 1000; timer++); // verzögern |
100 | if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
100 | if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
Line 121... | Line 121... | ||
121 | Timer_Init(); |
121 | Timer_Init(); |
122 | UART_Init(); |
122 | UART_Init(); |
123 | rc_sum_init(); |
123 | rc_sum_init(); |
124 | ADC_Init(); |
124 | ADC_Init(); |
125 | i2c_init(); |
125 | i2c_init(); |
- | 126 | SPI_MasterInit(); |
|
Line 126... | Line 127... | ||
126 | 127 | ||
Line 127... | Line 128... | ||
127 | sei(); |
128 | sei(); |
128 | 129 | ||
Line 180... | Line 181... | ||
180 | I2CTimeout = 5000; |
181 | I2CTimeout = 5000; |
181 | while (1) |
182 | while (1) |
182 | { |
183 | { |
183 | if (UpdateMotor) // ReglerIntervall |
184 | if (UpdateMotor) // ReglerIntervall |
184 | { |
185 | { |
- | 186 | SPI_TransmitByte(); |
|
185 | UpdateMotor=0; |
187 | UpdateMotor=0; |
186 | MotorRegler(); |
188 | MotorRegler(); |
187 | SendMotorData(); |
189 | SendMotorData(); |
188 | ROT_OFF; |
190 | ROT_OFF; |
189 | if(PcZugriff) PcZugriff--; |
191 | if(PcZugriff) PcZugriff--; |
190 | if(SenderOkay) SenderOkay--; |
192 | if(SenderOkay) SenderOkay--; |
Line 218... | Line 220... | ||
218 | { |
220 | { |
219 | beeptime = 6000; |
221 | beeptime = 6000; |
220 | BeepMuster = 0x0300; |
222 | BeepMuster = 0x0300; |
221 | } |
223 | } |
222 | } |
224 | } |
- | 225 | SPI_StartTransmitPacket(); |
|
223 | timer = SetDelay(100); |
226 | timer = SetDelay(100); |
224 | } |
227 | } |
225 | } |
228 | } |
226 | return (1); |
229 | return (1); |
227 | } |
230 | } |