Rev 1638 | Rev 1651 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1638 | Rev 1643 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | }; |
26 | }; |
Line 27... | Line 27... | ||
27 | 27 | ||
28 | 28 | ||
29 | ISR(TIMER0_OVF_vect) // 9,7kHz |
29 | ISR(TIMER0_OVF_vect) // 9,7kHz |
30 | { |
30 | { |
31 | static unsigned char cnt_1ms = 1,cnt = 0; |
31 | static unsigned char cnt_1ms = 1,cnt = 0, compass_active = 0; |
32 | unsigned char pieper_ein = 0; |
32 | unsigned char pieper_ein = 0; |
33 | if(SendSPI) SendSPI--; |
33 | if(SendSPI) SendSPI--; |
34 | if(SpektrumTimer) SpektrumTimer--; |
34 | if(SpektrumTimer) SpektrumTimer--; |
35 | if(!cnt--) |
35 | if(!cnt--) |
- | 36 | { |
|
36 | { |
37 | cnt = 9; |
37 | cnt = 9; |
38 | CountMilliseconds++; |
- | 39 | cnt_1ms++; |
|
38 | cnt_1ms++; |
40 | cnt_1ms %= 2; |
39 | cnt_1ms %= 2; |
41 | |
40 | if(!cnt_1ms) UpdateMotor = 1; |
42 | if(!cnt_1ms) UpdateMotor = 1; |
41 | CountMilliseconds++; |
43 | if(!PINC & 0x10) compass_active = 1; |
42 | } |
44 | |
43 | if(beeptime >= 1) |
45 | if(beeptime >= 10) |
44 | { |
46 | { |
45 | beeptime--; |
47 | beeptime -= 10; |
46 | if(beeptime & BeepMuster) |
48 | if(beeptime & BeepMuster) |
47 | { |
49 | { |
48 | pieper_ein = 1; |
50 | pieper_ein = 1; |
Line 62... | Line 64... | ||
62 | else |
64 | else |
63 | { |
65 | { |
64 | if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
66 | if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
65 | else PORTC &= ~(1<<7); |
67 | else PORTC &= ~(1<<7); |
66 | } |
68 | } |
67 | 69 | } |
|
68 | if(!NaviDataOkay && EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
70 | if(compass_active && !NaviDataOkay && EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
69 | { |
71 | { |
70 | if(PINC & 0x10) |
72 | if(PINC & 0x10) |
71 | { |
73 | { |
72 | cntKompass++; |
74 | if(++cntKompass > 1000) compass_active = 0; |
73 | } |
75 | } |
74 | else |
76 | else |
75 | { |
77 | { |
76 | if((cntKompass) && (cntKompass < 362)) |
78 | if((cntKompass) && (cntKompass < 362)) |
77 | { |
79 | { |