code:interrupt_driven_ubx
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
code:interrupt_driven_ubx [2009/05/11 10:01] – laurenceb | code:interrupt_driven_ubx [2009/05/11 20:17] (current) – laurenceb | ||
---|---|---|---|
Line 1: | Line 1: | ||
under construction... | under construction... | ||
+ | |||
+ | |||
+ | |||
Line 5: | Line 8: | ||
<code c> | <code c> | ||
- | |||
#include < | #include < | ||
#include < | #include < | ||
Line 40: | Line 42: | ||
if(Gps.packetflag==REQUIRED_DATA) | if(Gps.packetflag==REQUIRED_DATA) | ||
{ | { | ||
- | printf(" | + | printf(" |
Gps.packetflag=0; | Gps.packetflag=0; | ||
} | } | ||
Line 48: | Line 50: | ||
ISR(USART_RX_vect) // | ISR(USART_RX_vect) // | ||
{ | { | ||
- | static u08 state, | + | static u08 state, |
static u16 lenght; | static u16 lenght; | ||
static ubx_gps_type gps; | static ubx_gps_type gps; | ||
Line 80: | Line 82: | ||
case 5: //the most significant byte | case 5: //the most significant byte | ||
lenght|=c<< | lenght|=c<< | ||
+ | counter=0; | ||
state=6; | state=6; | ||
break; | break; | ||
Line 97: | Line 100: | ||
if(id==SOL_DATA && lenght==SOL_POS) | if(id==SOL_DATA && lenght==SOL_POS) | ||
gps.status=c; | gps.status=c; | ||
- | if(id==SVINFO_DATA | + | if(id==SOL_DATA |
- | gps.nosats=c; | + | gps.nosats=c; |
+ | / | ||
+ | { | ||
+ | counter++;// | ||
+ | if(counter==SATS_POS) | ||
+ | gps.nosats=c; | ||
+ | }*/ | ||
} | } | ||
lenght--; | lenght--; | ||
Line 145: | Line 154: | ||
} | } | ||
</ | </ | ||
+ | |||
===== header ===== | ===== header ===== | ||
- | <code c> | + | <code c> |
- | typedef unsigned char u08; | + | |
typedef uint16_t u16; | typedef uint16_t u16; | ||
typedef uint32_t u32; | typedef uint32_t u32; | ||
Line 172: | Line 181: | ||
#define NAV_CLASS 0x01 | #define NAV_CLASS 0x01 | ||
#define SATS_POS 5 | #define SATS_POS 5 | ||
- | #define SOL_POS | + | #define SOL_POS |
#define POS_OFFSET 40 | #define POS_OFFSET 40 | ||
#define POS_START 12 | #define POS_START 12 |
code/interrupt_driven_ubx.1242036094.txt.gz · Last modified: 2009/05/11 10:01 by laurenceb