Rev 254 | Rev 268 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 254 | Rev 264 | ||
---|---|---|---|
Line 58... | Line 58... | ||
58 | #include "compass.h" |
58 | #include "compass.h" |
59 | #include "mk3mag.h" |
59 | #include "mk3mag.h" |
60 | #include "ncmag.h" |
60 | #include "ncmag.h" |
61 | #include "uart1.h" |
61 | #include "uart1.h" |
62 | #include "fifo.h" |
62 | #include "fifo.h" |
- | 63 | #include "led.h" |
|
Line 63... | Line 64... | ||
63 | 64 | ||
64 | 65 | ||
Line 74... | Line 75... | ||
74 | #define COMPASS_NCMAG 2 |
75 | #define COMPASS_NCMAG 2 |
75 | u8 Compass_Device = COMPASS_NONE; |
76 | u8 Compass_Device = COMPASS_NONE; |
Line 76... | Line 77... | ||
76 | 77 | ||
77 | void Compass_Init(void) |
78 | void Compass_Init(void) |
- | 79 | { |
|
78 | { |
80 | Compass_Device = COMPASS_NONE; |
- | 81 | UART1_PutString("\r\n Looking for compass"); |
|
- | 82 | if(Version_HW > 11) |
|
79 | UART1_PutString("\r\n Looking for compass"); |
83 | { |
80 | if( MK3MAG_Init() ) Compass_Device = COMPASS_MK3MAG; |
84 | if( NCMAG_Init() ) Compass_Device = COMPASS_NCMAG; |
- | 85 | else if( MK3MAG_Init()) Compass_Device = COMPASS_MK3MAG; |
|
- | 86 | } |
|
- | 87 | else |
|
- | 88 | { |
|
81 | else if( NCMAG_Init() ) Compass_Device = COMPASS_NCMAG; |
89 | if( MK3MAG_Init() ) Compass_Device = COMPASS_MK3MAG; |
- | 90 | else if( NCMAG_Init() ) Compass_Device = COMPASS_NCMAG; |
|
- | 91 | } |
|
82 | else Compass_Device = COMPASS_NONE; |
92 | |
83 | fifo_init(&CompassCalcStateFiFo, CompassCalStateQueue, sizeof(CompassCalStateQueue), NO_ITLine, NO_ITLine); |
93 | fifo_init(&CompassCalcStateFiFo, CompassCalStateQueue, sizeof(CompassCalStateQueue), NO_ITLine, NO_ITLine); |
Line 84... | Line 94... | ||
84 | } |
94 | } |