ATmega8GPSLoggerBasismodul  20131018
atmega8_gps_logger_basismodul.c File Reference

Hauptfile des Projekts ATmega8 GPS Logger. More...

#include <avr/io.h>
#include <util/delay.h>
#include "gps.h"
#include "mmc.h"
#include "fat16.h"
Include dependency graph for atmega8_gps_logger_basismodul.c:

Go to the source code of this file.

Macros

#define F_CPU   16000000L
 
#define LED_PORT   PORTD
 
#define LED_STAT   PD6
 
#define LED_WARN   PD7
 
#define LEDCODE_OFF   LED_PORT &= ~((1 << LED_WARN) | (1 << LED_STAT))
 
#define LEDCODE_OK   LED_PORT = (LED_PORT & ~(1 << LED_WARN)) | (1 << LED_STAT)
 
#define LEDCODE_WARNING   LED_PORT = (LED_PORT & ~(1 << LED_STAT)) | (1 << LED_WARN)
 
#define LEDCODE_PROCESSING   LED_PORT |= (1 << LED_WARN) | (1 << LED_STAT)
 
#define LEDCODE_BLINK   LED_PORT ^= (1 << LED_STAT)
 

Functions

int main (void)
 Hauptfunktion. More...
 

Variables

struct {
   unsigned   record:1
 
   unsigned   keydown:1
 
status
 

Detailed Description

Hauptfile des Projekts ATmega8 GPS Logger.

Author
Martin Matysiak (mail@.nosp@m.k621.nosp@m..de)
V. Pippan (webma.nosp@m.ster.nosp@m.@vpip.nosp@m.pan..nosp@m.at)
Date
2013-10-18
Version
20131018

Copyright (c) 2008 Martin Matysiak
Copyright 2008-2013 V. Pippan (webma.nosp@m.ster.nosp@m.@vpip.nosp@m.pan..nosp@m.at)

This file is part of ATmega8 GPS Logger.

ATmega8 GPS Logger is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or any later version.

ATmega8 GPS Logger is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ATtiny2313 Cessna Lichtsteuerung. If not, see
www.gnu.org/licenses.

Todo:
  • Code schöner schreiben, Kommtentare einfügen, Doxygen Doku verbessern
  • FAT, UART und MMC Libraries in eigenem Ordner speichern
  • In neuer Version auf FAT verzichten und Daten ohne Dateisystem auf SD Karte schreiben (siehe gLoggerMini) -> weniger Speicher für Code, schneller?
  • Wartezeit für GPS Datenempfang einstellbar machen (eventuell nur Positionsdaten auslesen?)
  • GPS Maus mit anderen Einstellungen initialisieren (höhere Datenrate, andere NMEA Sätze?)
  • Start / Stop aus dem File entfernen -> Überprüfen ob Datei vorhanden und dann neue anlegen (Dateinamen bei jedem starten ändern und damit neue Datei anlegen -> String append ?)
  • Akkuspannung messen und bei zu niedriger Spannung -> sleep mode (Datei abschließen), GPS und Zusatzmodul abschalten und warnen
  • GPS nur einschalten wenn Aufzeichnung aktiviert, sonst ausschalten
  • GPS Daten auf Display ausgeben, zusätzliche Sensoren, Jeti Kommunikation -> größerer uC benötigt? -> ATmega32?
  • Berechnungen für Oldtimerrallye Training machen und am Display ausgeben
  • Erkennung von Zusatzmodulen und Code für diese
  • Bei Verwendung mit LCD Zusatzmodul das Logging abschaltbar machen -> nur Anzeige der Daten

Definition in file atmega8_gps_logger_basismodul.c.

Macro Definition Documentation

#define F_CPU   16000000L

Definition at line 51 of file atmega8_gps_logger_basismodul.c.

Referenced by gps_init().

#define LED_PORT   PORTD

Definition at line 53 of file atmega8_gps_logger_basismodul.c.

#define LED_STAT   PD6

Definition at line 54 of file atmega8_gps_logger_basismodul.c.

#define LED_WARN   PD7

Definition at line 55 of file atmega8_gps_logger_basismodul.c.

#define LEDCODE_BLINK   LED_PORT ^= (1 << LED_STAT)

Definition at line 61 of file atmega8_gps_logger_basismodul.c.

Referenced by main().

#define LEDCODE_OFF   LED_PORT &= ~((1 << LED_WARN) | (1 << LED_STAT))

Definition at line 57 of file atmega8_gps_logger_basismodul.c.

Referenced by main().

#define LEDCODE_OK   LED_PORT = (LED_PORT & ~(1 << LED_WARN)) | (1 << LED_STAT)

Definition at line 58 of file atmega8_gps_logger_basismodul.c.

Referenced by main().

#define LEDCODE_PROCESSING   LED_PORT |= (1 << LED_WARN) | (1 << LED_STAT)

Definition at line 60 of file atmega8_gps_logger_basismodul.c.

Referenced by main().

#define LEDCODE_WARNING   LED_PORT = (LED_PORT & ~(1 << LED_STAT)) | (1 << LED_WARN)

Definition at line 59 of file atmega8_gps_logger_basismodul.c.

Referenced by main().

Function Documentation

int main ( void  )

Hauptfunktion.

Die Hauptfunktion enthält die Initialisierungen beim Programmstart und die Hauptschleife des Programms.

< definiert ein character feld für nmea daten mit 128 zeichen länge

Hauptschleife

Definition at line 74 of file atmega8_gps_logger_basismodul.c.

References fclose_(), fopen_(), fputs_(), gps_get_nmea(), gps_init(), InitFat16(), LEDCODE_BLINK, LEDCODE_OFF, LEDCODE_OK, LEDCODE_PROCESSING, LEDCODE_WARNING, mmc_init(), and status.

Here is the call graph for this function:

Variable Documentation

unsigned keydown

Definition at line 66 of file atmega8_gps_logger_basismodul.c.

unsigned record

Definition at line 65 of file atmega8_gps_logger_basismodul.c.

struct { ... } status

Referenced by main().