Rev 373 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 373 | Rev 378 | ||
---|---|---|---|
Line 17... | Line 17... | ||
17 | T0_FALLING_EDGE = 6, |
17 | T0_FALLING_EDGE = 6, |
18 | T0_RISING_EDGE = 7 |
18 | T0_RISING_EDGE = 7 |
19 | }; |
19 | }; |
Line 20... | Line 20... | ||
20 | 20 | ||
21 | 21 | ||
22 | SIGNAL (SIG_OVERFLOW0) // 8kHz |
22 | SIGNAL (SIG_OVERFLOW0) // 9,8kHz |
23 | { |
23 | { |
Line 24... | Line 24... | ||
24 | static unsigned char cnt_1ms = 1,cnt = 0; |
24 | static unsigned char cnt_1ms = 1,cnt = 0; |
25 | // TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
25 | // TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
26 | 26 | ||
27 | if(!cnt--) |
27 | if(!cnt--) |
28 | { |
28 | { |
29 | cnt = 9; |
29 | cnt = 10; |
30 | cnt_1ms++; |
30 | cnt_1ms++; |
31 | cnt_1ms %= 2; |
31 | cnt_1ms %= 2; |
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 | timer0_MM3(); // Kompass auslesen |
47 | timer0_MM3(); // Kompass auslesen |
48 | 48 | ||
49 | if (!cntKompass--) // Aufruf mit ~10 Hz |
49 | if (!cntKompass--) // Aufruf mit 10 Hz |
50 | { |
50 | { |
51 | KompassValue = heading_MM3(); |
51 | KompassValue = heading_MM3(); |
52 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
52 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
53 | cntKompass = 800; |
53 | cntKompass = 980; |
54 | } |
- | |
55 | } |
- | |
56 | 54 | } |
|
Line 57... | Line 55... | ||
57 | 55 | } |
|
58 | } |
56 | } |