Rev 1424 | Rev 1481 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1424 | Rev 1469 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | SIGNAL (SIG_OVERFLOW0) // 9,7kHz |
29 | SIGNAL (SIG_OVERFLOW0) // 9,7kHz |
30 | { |
30 | { |
31 | static unsigned char cnt_1ms = 1,cnt = 0; |
31 | static unsigned char cnt_1ms = 1,cnt = 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--; |
Line 35... | Line 35... | ||
35 | 35 | ||
36 | if(!cnt--) |
36 | if(!cnt--) |
37 | { |
37 | { |
38 | cnt = 9; |
38 | cnt = 9; |
Line 78... | Line 78... | ||
78 | { |
78 | { |
79 | if((cntKompass) && (cntKompass < 362)) |
79 | if((cntKompass) && (cntKompass < 362)) |
80 | { |
80 | { |
81 | cntKompass += cntKompass / 41; |
81 | cntKompass += cntKompass / 41; |
82 | if(cntKompass > 10) KompassValue = cntKompass - 10; else KompassValue = 0; |
82 | if(cntKompass > 10) KompassValue = cntKompass - 10; else KompassValue = 0; |
83 | } |
- | |
84 | // if(cntKompass < 10) cntKompass =r 10; |
- | |
85 | // KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L; |
- | |
86 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
83 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
- | 84 | } |
|
87 | cntKompass = 0; |
85 | cntKompass = 0; |
88 | } |
86 | } |
89 | } |
87 | } |
90 | } |
88 | } |
Line 130... | Line 128... | ||
130 | { |
128 | { |
131 | uint8_t sreg = SREG; |
129 | uint8_t sreg = SREG; |
Line 132... | Line 130... | ||
132 | 130 | ||
133 | // disable all interrupts before reconfiguration |
131 | // disable all interrupts before reconfiguration |
134 | cli(); |
132 | cli(); |
135 | 133 | ||
Line 136... | Line 134... | ||
136 | PORTD &= ~(1<<PORTD7); // set PD7 to low |
134 | PORTD &= ~(1<<PORTD7); // set PD7 to low |
137 | 135 | ||
138 | DDRC |= (1<<DDC6); // set PC6 as output (Reset for HEF4017) |
136 | DDRC |= (1<<DDC6); // set PC6 as output (Reset for HEF4017) |