code:ground_control
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
code:ground_control [2008/11/13 00:40] – laurenceb | code:ground_control [2008/11/13 09:50] (current) – laurenceb | ||
---|---|---|---|
Line 13: | Line 13: | ||
void run_ground_control(); | void run_ground_control(); | ||
</ | </ | ||
+ | |||
====Main code=== | ====Main code=== | ||
Line 20: | Line 21: | ||
#include " | #include " | ||
extern volatile u08 counter; | extern volatile u08 counter; | ||
- | extern volatile | + | extern volatile |
Line 36: | Line 37: | ||
if(!(counter& | if(!(counter& | ||
{ | { | ||
- | diff=(s16)(ICR1>> | + | diff=ICR1; |
- | if(start> | + | if(start> |
{ | { | ||
- | diff+=(s16)(TOP_COUNT>>1); | + | diff+=TOP_COUNT; |
} | } | ||
+ | diff-=start; | ||
if(diff> | if(diff> | ||
{ | { | ||
Line 61: | Line 63: | ||
{ | { | ||
counter|=0x80; | counter|=0x80; | ||
- | OCR1B=((u16)diff)<<1; | + | OCR1B=diff; |
counter& | counter& | ||
GROUND_LED_ON; | GROUND_LED_ON; |
code/ground_control.1226536805.txt.gz · Last modified: 2008/11/13 00:40 by laurenceb