code:interrupt_driven_nmea
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
code:interrupt_driven_nmea [2008/04/26 04:48] – laurenceb | code:interrupt_driven_nmea [2013/04/18 20:00] (current) – Reports code isn't tested so just put a notice on there upu | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | This is a rather unconvensional approach to a NMEA parser - completely based on an ISR to parse the incoming bytes. It uses 1.9KB of code space and 44 bytes of RAM. Should run in less than 10us at 18MHz. | + | **This code hasn't been tested and is believe not to work** |
+ | |||
+ | |||
+ | This is a rather unconvensional approach to a NMEA parser - completely based on an ISR to parse the incoming bytes. It uses 1.9KB of code space and 44 bytes of RAM. Should run in less than 10us at 18MHz. | ||
<code c># | <code c># | ||
//global(s) | //global(s) | ||
- | extern gps_type | + | extern gps_type |
// Interrupt driven NMEA parser for Atmel AVR | // Interrupt driven NMEA parser for Atmel AVR | ||
Line 17: | Line 20: | ||
static u08 bufferindex; | static u08 bufferindex; | ||
static u08 pointcount; | static u08 pointcount; | ||
+ | static gps_type gps; | ||
char c=UDR0; | char c=UDR0; | ||
switch(c) | switch(c) | ||
Line 129: | Line 133: | ||
gps.heading=(float)atoi(buffer)*0.1; | gps.heading=(float)atoi(buffer)*0.1; | ||
toggle_pin; | toggle_pin; | ||
- | gps.packetflag=TRUE; | + | if(!Gps.packetflag) // |
+ | { | ||
+ | Gps.packetflag=TRUE; | ||
+ | Gps=gps; | ||
+ | } | ||
} | } | ||
} | } |
code/interrupt_driven_nmea.1209185280.txt.gz · Last modified: 2008/07/19 23:31 (external edit)