Rev 889 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 889 | Rev 891 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include "main.h" |
1 | #include "main.h" |
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; |
- | |
6 | volatile unsigned int cntKompass = 0; |
5 | volatile unsigned char UpdateMotor = 0; |
7 | volatile unsigned int beeptime = 0; |
6 | volatile unsigned int beeptime = 0; |
Line 8... | Line 7... | ||
8 | volatile unsigned char SendSPI = 0; |
7 | volatile unsigned char SendSPI = 0; |
9 | 8 | ||
Line 62... | Line 61... | ||
62 | { |
61 | { |
63 | if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
62 | if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
64 | else PORTC &= ~(1<<7); |
63 | else PORTC &= ~(1<<7); |
65 | } |
64 | } |
Line 66... | Line 65... | ||
66 | 65 | ||
67 | if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
- | |
68 | { |
- | |
69 | if(PINC & 0x10) |
- | |
70 | { |
- | |
71 | cntKompass++; |
- | |
72 | } |
- | |
73 | else |
- | |
74 | { |
- | |
75 | if((cntKompass) && (cntKompass < 362)) |
- | |
76 | { |
- | |
77 | cntKompass += cntKompass / 41; |
- | |
78 | if(cntKompass > 10) KompassValue = cntKompass - 10; else KompassValue = 0; |
- | |
79 | } |
- | |
80 | // if(cntKompass < 10) cntKompass = 10; |
- | |
81 | // KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L; |
- | |
82 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
- | |
83 | cntKompass = 0; |
- | |
84 | } |
- | |
85 | } |
66 | if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) timer0_MM3(); // Kompass auslesen |
Line 86... | Line 67... | ||
86 | } |
67 | } |
87 | 68 |