Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 410 → Rev 411

/FollowMe/temp/FollowMe/main.c
14,7 → 14,7
#include "analog.h"
#include "gps.h"
#include "button.h"
#include "logging.h"
//#include "logging.h"
#include "settings.h"
 
#define FOLLOWME_INTERVAL 1000 // 1 second update
63,8 → 63,6
// enable interrupts global
sei();
 
Fat16_Init();
 
LEDRED_OFF;
LEDGRN_ON;
 
74,7 → 72,7
// initialize the settings
Settings_Init();
// initialize logging (needs settings)
Logging_Init();
//Logging_Init();
 
#ifdef USE_SDLOGGER
printf("\r\n\r\nHW: SD-Logger");
209,7 → 207,7
BeepModulation = 0x0300;
if(!BeepTime)
{
BeepTime = 6000; // 0.6 seconds
//BeepTime = 6000; // 0.6 seconds
}
Error |= ERROR_LOW_BAT;
}
/FollowMe/temp/FollowMe/makefile
76,7 → 76,7
 
##########################################################################################################
# List C source files here. (C dependencies are automatically generated.)
SRC = main.c uart0.c uart1.c printf_P.c timer0.c menu.c led.c ubx.c analog.c button.c crc16.c ssc.c sdc.c fat16.c gps.c settings.c gpx.c kml.c logging.c
SRC = main.c uart0.c uart1.c printf_P.c timer0.c menu.c led.c ubx.c analog.c button.c crc16.c ssc.c sdc.c fat16.c gps.c settings.c
 
##########################################################################################################
 
/FollowMe/temp/FollowMe/settings.c
57,11 → 57,10
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "printf_P.h"
#include "fat16.h"
#include "settings.h"
#include "uart0.h"
#include "uart1.h"
#include "main.h"
 
typedef struct
{
117,8 → 116,7
// out of range ?
if((CFG_Parameter[i].Value < CFG_Parameter[i].Min) || (CFG_Parameter[i].Value > CFG_Parameter[i].Max))
{ // print a warning
sprintf(text,"\r\n%s <-- %d is out of range [%d...%d]", string, CFG_Parameter[i].Value, CFG_Parameter[i].Min, CFG_Parameter[i].Max);
printf(text);
printf("\r\n%s <-- %d is out of range [%d...%d]", string, CFG_Parameter[i].Value, CFG_Parameter[i].Min, CFG_Parameter[i].Max);
CFG_Parameter[i].Value = CFG_Parameter[i].Default; // fallback to default
}
retval = 1; // value in range
126,9 → 124,8
}
}
if(!retval)
{
sprintf(text,"\r\n%s <-- unknown parameter\r\n", string);
printf(text);
{
printf("\r\n%s <-- unknown parameter\r\n", string);
}
return(retval);
}
144,13 → 141,13
uint8_t i;
char *tmp;
 
printf("\n\rSettings init...");
printf("\r\nSettings init...");
Settings_SetDefaultValues();
 
if(Fat16_IsValid())
{ // check if settings file is existing
if(fexist_("settings.ini"))
{
{
fp = fopen_("settings.ini", 'r'); // try to open the file
if (fp == NULL) // could not open the file
{
186,7 → 183,7
if(fp == NULL)
{
printf("ERROR: Creating default settings file!");
return;
return;
}
// run thrue all parameters and set value to default
for (i = 0; i < sizeof(CFG_Parameter) / sizeof(Parameter_t); i++)
/FollowMe/temp/FollowMe/settings.h
1,11 → 1,6
#ifndef _SETTINGS_H
#define _SETTINGS_H
 
#include <avr/boot.h>
 
#include <avr/io.h>
#include <avr/interrupt.h>
 
typedef enum
{
PID_KML_LOGGING,