Subversion Repositories FlightCtrl

Rev

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

Rev 2380 Rev 2386
Line 276... Line 276...
276
        if(ReceiverUpdateModeActive) while (1) PORTC &= ~(1<<7); // Beeper off
276
        if(ReceiverUpdateModeActive) while (1) PORTC &= ~(1<<7); // Beeper off
277
//GRN_ON;
277
//GRN_ON;
278
        if(UpdateMotor && AdReady)      // ReglerIntervall
278
        if(UpdateMotor && AdReady)      // ReglerIntervall
279
            {
279
            {
280
//GRN_OFF;
280
//GRN_OFF;
-
 
281
cli();
281
                        UpdateMotor=0;    
282
                        UpdateMotor--;    
-
 
283
sei();
282
            if(WinkelOut.CalcState) CalMk3Mag();
284
            if(WinkelOut.CalcState) CalMk3Mag();
283
            else  MotorRegler();
285
            else  MotorRegler();
284
                        SendMotorData();
286
                        SendMotorData();
285
            ROT_OFF;
287
            ROT_OFF;
286
            if(SenderOkay)  { SenderOkay--; /*VersionInfo.HardwareError[1] &= ~FC_ERROR1_PPM;*/ }
288
            if(SenderOkay)  { SenderOkay--; /*VersionInfo.HardwareError[1] &= ~FC_ERROR1_PPM;*/ }
Line 417... Line 419...
417
                                                beeptime = 6000;
419
                                                beeptime = 6000;
418
                                                BeepMuster = 0x0300;
420
                                                BeepMuster = 0x0300;
419
                                        }
421
                                        }
420
                                }
422
                                }
421
                                else if(!beeptime) FC_StatusFlags &= ~FC_STATUS_LOWBAT;
423
                                else if(!beeptime) FC_StatusFlags &= ~FC_STATUS_LOWBAT;
422
                                SendSPI = SPI_BYTEGAP;
424
//                              SendSPI = SPI_BYTEGAP;
423
                                EEAR = EE_DUMMY;  // Set the EEPROM Address pointer to an unused space
425
                                EEAR = EE_DUMMY;  // Set the EEPROM Address pointer to an unused space
424
                                // +++++++++++++++++++++++++++++++++
426
                                // +++++++++++++++++++++++++++++++++
425
                                // Sekundentakt
427
                                // Sekundentakt
426
                if(++second == 49)
428
                if(++second == 49)
427
                                 {
429
                                 {
Line 451... Line 453...
451
                                   timer = SetDelay(20); // falls "timer += 20;" mal nicht geht
453
                                   timer = SetDelay(20); // falls "timer += 20;" mal nicht geht
452
                             }
454
                             }
453
                        }
455
                        }
454
           LED_Update();
456
           LED_Update();
455
           Capacity_Update();
457
           Capacity_Update();
-
 
458
           }
456
           } //else DebugOut.Analog[26]++;
459
          } //else DebugOut.Analog[18]++;
457
          }
-
 
458
                  if(update_spi) update_spi--;
460
                  if(update_spi) update_spi--;
459
                 } // 500Hz
461
                 } // 500Hz
-
 
462
         if(update_spi == 0) // 41Hz
-
 
463
          {
460
         if(update_spi == 0) { SPI_StartTransmitPacket(); update_spi = 12;}  // 41Hz
464
            if(SPI_StartTransmitPacket()) update_spi = 12;
-
 
465
                else
-
 
466
                if(BytegapSPI == 0)  SPI_TransmitByte();  
-
 
467
           }  
461
         else if(!SendSPI) { SPI_TransmitByte(); }
468
         else if(BytegapSPI == 0)  SPI_TransmitByte();
462
    }
469
    }
463
}
470
}
464
//DebugOut.Analog[16]
471
//DebugOut.Analog[16]