Subversion Repositories FlightCtrl

Rev

Rev 1658 | Rev 1662 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1658 Rev 1660
Line 113... Line 113...
113
        unsigned int timer,i,timer2 = 0, timerPolling;
113
        unsigned int timer,i,timer2 = 0, timerPolling;
Line 114... Line 114...
114
 
114
 
115
    DDRB  = 0x00;
115
    DDRB  = 0x00;
116
    PORTB = 0x00;
116
    PORTB = 0x00;
-
 
117
    for(timer = 0; timer < 1000; timer++); // verzögern
-
 
118
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
119
        PlatinenVersion = 21;
117
    for(timer = 0; timer < 1000; timer++); // verzögern
120
#else
118
    if(PINB & 0x01)
121
        if(PINB & 0x01)
119
     {
122
     {
120
      if(PINB & 0x02) PlatinenVersion = 13;
123
      if(PINB & 0x02) PlatinenVersion = 13;
121
       else           PlatinenVersion = 11;
124
       else           PlatinenVersion = 11;
122
     }
125
     }
123
    else
126
    else
124
     {
127
     {
125
      if(PINB & 0x02) PlatinenVersion = 20;
128
      if(PINB & 0x02) PlatinenVersion = 20;
126
       else           PlatinenVersion = 10;
129
       else           PlatinenVersion = 10;
127
     }
130
     }
128
 
131
#endif
129
    DDRC  = 0x81; // SCL
132
    DDRC  = 0x81; // SCL
130
    DDRC  |=0x40; // HEF4017 Reset
133
    DDRC  |=0x40; // HEF4017 Reset
131
    PORTC = 0xff; // Pullup SDA
134
    PORTC = 0xff; // Pullup SDA
132
    DDRB  = 0x1B; // LEDs und Druckoffset
135
    DDRB  = 0x1B; // LEDs und Druckoffset
Line 137... Line 140...
137
    MCUSR &=~(1<<WDRF);
140
    MCUSR &=~(1<<WDRF);
138
    WDTCSR |= (1<<WDCE)|(1<<WDE);
141
    WDTCSR |= (1<<WDCE)|(1<<WDE);
139
    WDTCSR = 0;
142
    WDTCSR = 0;
Line 140... Line 143...
140
 
143
 
141
    beeptime = 2500;
144
    beeptime = 2500;
142
        StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0;
145
        StickGier = 0; PPM_in[K_GAS] = 0; StickRoll = 0; StickNick = 0;
143
    if(PlatinenVersion >= 20)  GIER_GRAD_FAKTOR = 1000; else GIER_GRAD_FAKTOR = 1291; // unterschiedlich für ME und ENC
146
    if(PlatinenVersion >= 20)  GIER_GRAD_FAKTOR = 1220; else GIER_GRAD_FAKTOR = 1291; // unterschiedlich für ME und ENC
Line 144... Line 147...
144
    ROT_OFF;
147
    ROT_OFF;
145
 
148
 
146
    Timer_Init();
149
    Timer_Init();