Subversion Repositories FlightCtrl

Rev

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

Rev 1423 Rev 1424
Line 152... Line 152...
152
//############################################################################
152
//############################################################################
153
//Hauptprogramm
153
//Hauptprogramm
154
int main (void)
154
int main (void)
155
//############################################################################
155
//############################################################################
156
{
156
{
157
        unsigned int timer,i,timer2 = 0, timerJeti;
157
        unsigned int timer,i,timer2 = 0, timerPolling;
158
    DDRB  = 0x00;
158
    DDRB  = 0x00;
159
    PORTB = 0x00;
159
    PORTB = 0x00;
160
    for(timer = 0; timer < 1000; timer++); // verzögern
160
    for(timer = 0; timer < 1000; timer++); // verzögern
161
    if(PINB & 0x01)
161
    if(PINB & 0x01)
162
     {
162
     {
Line 192... Line 192...
192
    rc_sum_init();
192
    rc_sum_init();
193
        ADC_Init();
193
        ADC_Init();
194
        i2c_init();
194
        i2c_init();
195
        SPI_MasterInit();
195
        SPI_MasterInit();
Line 196... Line -...
196
 
-
 
197
    if(UCSR1A == 0x20 && UCSR1C == 0x06)  // initial Values for 644P
-
 
198
     {
196
 
199
      //Uart1Init();
-
 
200
          JetiBoxUartInit();
-
 
201
     }
197
    InitFC();
202
 
198
   
203
        sei();
199
        sei();
204
        printf("\n\r===================================");
200
        printf("\n\r===================================");
205
        printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR,VERSION_PATCH + 'a');
201
        printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR,VERSION_PATCH + 'a');
206
        printf("\n\rthe use of this software is only permitted \n\ron original MikroKopter-Hardware");
202
        printf("\n\rthe use of this software is only permitted \n\ron original MikroKopter-Hardware");
Line 362... Line 358...
362
    WinkelOut.Orientation = 1;
358
    WinkelOut.Orientation = 1;
363
    LipoDetection(1);
359
    LipoDetection(1);
364
        printf("\n\r===================================\n\r");
360
        printf("\n\r===================================\n\r");
365
//SpektrumBinding();
361
//SpektrumBinding();
366
    timer = SetDelay(2000);
362
    timer = SetDelay(2000);
367
        timerJeti = SetDelay(250);
363
        timerPolling = SetDelay(250);
368
        while (1)
364
        while (1)
369
        {
365
        {
Line 370... Line 366...
370
 
366
 
371
        if(CheckDelay(timerJeti))
367
        if(CheckDelay(timerPolling))
372
        {
368
        {
373
          timerJeti = SetDelay(100);
369
          timerPolling = SetDelay(100);
374
          JetiBoxPolling();
370
          Polling();
Line 375... Line 371...
375
        }
371
        }
376
 
372
 
377
        if(UpdateMotor && AdReady)      // ReglerIntervall
373
        if(UpdateMotor && AdReady)      // ReglerIntervall