Subversion Repositories FlightCtrl

Rev

Rev 251 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 251 Rev 341
Line 2... Line 2...
2
 
2
 
3
volatile unsigned int CountMilliseconds = 0;
3
volatile unsigned int CountMilliseconds = 0;
4
volatile static unsigned int tim_main;
4
volatile static unsigned int tim_main;
5
volatile unsigned char UpdateMotor = 0;
5
volatile unsigned char UpdateMotor = 0;
6
volatile unsigned int beeptime = 0;
6
volatile unsigned int beeptime = 0;
7
volatile unsigned int cntKompass = 0;
7
volatile unsigned int cntKompass = 800;
Line 8... Line 8...
8
int ServoValue = 0;
8
int ServoValue = 0;
9
 
9
 
10
enum {
10
enum {
Line 44... Line 44...
44
 
44
 
45
        if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)
45
        if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)
46
        {
46
        {
Line 47... Line 47...
47
                MM3_timer0();           // Kompass auslesen
47
                MM3_timer0();           // Kompass auslesen
48
 
48
 
49
                if (!cntKompass--)              // Aufruf mit 25 Hz
49
                if (!cntKompass--)              // Aufruf mit 10 Hz
50
                {
50
                {
51
                        KompassValue = MM3_heading();
51
                        KompassValue = MM3_heading();
52
                        KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
52
                        KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
53
                        cntKompass = 320;
53
                        cntKompass = 800;
Line 54... Line 54...
54
                }
54
                }
Line 63... Line 63...
63
    tim_main = SetDelay(10);
63
    tim_main = SetDelay(10);
64
    TCCR0B = CK8;
64
    TCCR0B = CK8;
65
    TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM
65
    TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM
66
    OCR0A =  0;
66
    OCR0A =  0;
67
    OCR0B = 120;
67
    OCR0B = 120;
68
    TCNT0 = -TIMER_RELOAD_VALUE;  // reload
68
    //TCNT0 = -TIMER_RELOAD_VALUE;  // reload
69
    //OCR1  = 0x00;
69
    //OCR1  = 0x00;
Line 70... Line 70...
70
 
70
 
71
    TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3;
71
    TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3;