UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


code:interrupt_driven_nmea

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
code:interrupt_driven_nmea [2008/04/26 04:48] laurencebcode: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>#include "main.h" <code c>#include "main.h"
 //global(s) //global(s)
-extern gps_type gps;+extern gps_type Gps;
    
 // 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; //toggles pin D5 - flashing LED  toggle_pin; //toggles pin D5 - flashing LED
- gps.packetflag=TRUE; //this is usually the last interesting part of the fix info to come through+ if(!Gps.packetflag) //main has unlocked the data 
 +
 + Gps.packetflag=TRUE; //this is usually the last interesting part of the fix info to come through 
 + Gps=gps; //copy into the global variable 
 + }
  }  }
  }  }
code/interrupt_driven_nmea.1209185280.txt.gz · Last modified: 2008/07/19 23:31 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki