Changeset - 0e169f68c994
[Not reviewed]
default
0 13 0
ethanzonca@CL-ENS241-08.cedarville.edu - 12 years ago 2013-01-09 22:10:43
ethanzonca@CL-ENS241-08.cedarville.edu
Added support for UART1, added numerous fixes. Introduction of GPS has caused several difficulties. Lowering baud rate to 4800 has made problems worse, probably change back to 115200 baud and disable serial1 interrupts when AFSK transmitting / logging.
13 files changed with 136 insertions and 84 deletions:
0 comments (0 inline, 0 general)
master/master/config.h
Show inline comments
 
/*
 
 * Master Firmware: Configuration
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
#ifndef CONFIG_H_
 
#define CONFIG_H_
 
 
// --------------------------------------------------------------------------
 
// Module config (master.c)
 
// --------------------------------------------------------------------------
 
 
#define F_CPU 11059200
 
#define MODULE_ID '1'
 
 
 
// --------------------------------------------------------------------------
 
// Error Codes config (led.c, used throughout code)
 
// --------------------------------------------------------------------------
 
 
// SD Card
 
#define ERROR_SD_INIT 2
 
#define ERROR_SD_PARTITION 3
 
#define ERROR_CRAP 6
 
 
// --------------------------------------------------------------------------
 
// Slave Sensors config (slavesensors.c)
 
// --------------------------------------------------------------------------
 
 
// NOT USED. Could integrate into slavesensors.c setup function for configurability eventually.
 
// Currently manual configuration of sensors is done in slavesensors.c
 
#define SLAVE0_SENSORS BOARDTEMP
 
#define SLAVE1_SENSORS BOARDTEMP | HUMIDITY | TEMPERATURE | PRESSURE | AMBIENTLIGHT
 
#define SLAVE2_SENSORS BOARDTEMP | GEIGER
 
#define SLAVE3_SENSORS BOARDTEMP | CAMERA
 
#define SLAVE4_SENSORS NONE
 
#define SLAVE5_SENSORS NONE
 
#define SLAVE6_SENSORS NONE
 
#define SLAVE7_SENSORS NONE
 
 
// MAX_SLAVES should be one more than the number of slaves we actually have (loop ends when next slave first sensor is NONE)
 
#define MAX_SLAVES 8
 
#define MAX_SLAVE_SENSORS 8
 
 
// --------------------------------------------------------------------------
 
// Command Parser config (serparser.c)
 
// --------------------------------------------------------------------------
 
 
// Maximum payload size of command
 
#define MAX_PAYLOAD_LEN 16
 
 
// Circular serial buffer size. Must be at least MAX_CMD_LEN + 5
 
#define BUFFER_SIZE 32 
 
 
// Public broadcast address
 
#define BROADCAST_ADDR 0 
 
 
// --------------------------------------------------------------------------
 
// USART config (serial.c)
 
// --------------------------------------------------------------------------
 
 
#define USART0_BAUDRATE 115200
 
#define USART1_BAUDRATE 115200
 
#define USART1_BAUDRATE 4800
 
 
 
// --------------------------------------------------------------------------
 
// AX.25 config (ax25.c)
 
// --------------------------------------------------------------------------
 

	
 
// TX delay in milliseconds
 
#define TX_DELAY      300
 

	
 
// Maximum packet delay
 
#define MAX_PACKET_LEN 512  // bytes
 
 

	
 
// --------------------------------------------------------------------------
 
// APRS config (aprs.c)
 
// --------------------------------------------------------------------------
 

	
 
// Set your callsign and SSID here. Common values for the SSID are
 
// (from http://zlhams.wikidot.com/aprs-ssidguide):
 
//
 
// - Balloons:  11
 
// - Cars:       9
 
// - Home:       0
 
// - IGate:      5
 
#define S_CALLSIGN      "KD8TDF"
 
#define S_CALLSIGN_ID   11
 
#define S_CALLSIGN_ID   9 // 11
 

	
 
// Destination callsign: APRS (with SSID=0) is usually okay.
 
#define D_CALLSIGN      "APRS"
 
#define D_CALLSIGN_ID   0
 

	
 
// Digipeating paths:
 
// (read more about digipeating paths here: http://wa8lmf.net/DigiPaths/ )
 
// The recommended digi path for a balloon is WIDE2-1 or pathless. The default
 
// is pathless. Uncomment the following two lines for WIDE2-1 path:
 
#define DIGI_PATH1      "WIDE2"
 
#define DIGI_PATH1_TTL  1
 

	
 
// APRS comment: this goes in the comment portion of the APRS message. You
 
// might want to keep this short. The longer the packet, the more vulnerable
 
// it is to noise.
 
#define APRS_COMMENT    "Payload data..."
 
#define APRS_COMMENT    "CedarvilleUniversity HAB"
 
 
// Transmit the APRS sentence every X milliseconds
 
#define APRS_TRANSMIT_PERIOD 5000
 
#define APRS_TRANSMIT_PERIOD 10000
 

	
 

	
 
// --------------------------------------------------------------------------
 
// Logger config (logger.c)
 
// --------------------------------------------------------------------------
 
 
#define LOGGER_ID_EEPROM_ADDR 0x10
 
 
// Written to the beginning of every log file
 
#define LOGGER_HEADERTEXT "HAB Control Master - 1.0\n"
 
 
// Log to SD card every X milliseconds
 
#define LOGGER_RATE 1000 
 
 
// LED cycle indicator speed
 
#define LEDCYCLE_RATE 100 
 
 
#endif /* CONFIG_H_ */
 
\ No newline at end of file
master/master/lib/afsk.c
Show inline comments
 
@@ -26,98 +26,101 @@ PROGMEM extern const uint8_t afsk_sine_t
 
  127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143, 144, 146, 147, 149, 150, 152, 153, 155, 156, 158, 
 
  159, 161, 163, 164, 166, 167, 168, 170, 171, 173, 174, 176, 177, 179, 180, 182, 183, 184, 186, 187, 188, 
 
  190, 191, 193, 194, 195, 197, 198, 199, 200, 202, 203, 204, 205, 207, 208, 209, 210, 211, 213, 214, 215, 
 
  216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228, 228, 229, 230, 231, 232, 233, 234, 235, 236, 
 
  236, 237, 238, 239, 239, 240, 241, 242, 242, 243, 244, 244, 245, 245, 246, 247, 247, 248, 248, 249, 249, 
 
  249, 250, 250, 251, 251, 251, 252, 252, 252, 253, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 
 
  254, 254, 255, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 253, 253, 253, 253, 252, 252, 252, 251, 
 
  251, 251, 250, 250, 249, 249, 249, 248, 248, 247, 247, 246, 245, 245, 244, 244, 243, 242, 242, 241, 240, 
 
  239, 239, 238, 237, 236, 236, 235, 234, 233, 232, 231, 230, 229, 228, 228, 227, 226, 225, 224, 223, 221, 
 
  220, 219, 218, 217, 216, 215, 214, 213, 211, 210, 209, 208, 207, 205, 204, 203, 202, 200, 199, 198, 197, 
 
  195, 194, 193, 191, 190, 188, 187, 186, 184, 183, 182, 180, 179, 177, 176, 174, 173, 171, 170, 168, 167, 
 
  166, 164, 163, 161, 159, 158, 156, 155, 153, 152, 150, 149, 147, 146, 144, 143, 141, 139, 138, 136, 135, 
 
  133, 132, 130, 129, 127, 125, 124, 122, 121, 119, 118, 116, 115, 113, 111, 110, 108, 107, 105, 104, 102, 
 
  101,  99,  98,  96,  95,  93,  91,  90,  88,  87,  86,  84,  83,  81,  80,  78,  77,  75,  74,  72,  71, 
 
   70,  68,  67,  66,  64,  63,  61,  60,  59,  57,  56,  55,  54,  52,  51,  50,  49,  47,  46,  45,  44, 
 
   43,  41,  40,  39,  38,  37,  36,  35,  34,  33,  31,  30,  29,  28,  27,  26,  26,  25,  24,  23,  22, 
 
   21,  20,  19,  18,  18,  17,  16,  15,  15,  14,  13,  12,  12,  11,  10,  10,   9,   9,   8,   7,   7, 
 
    6,   6,   5,   5,   5,   4,   4,   3,   3,   3,   2,   2,   2,   1,   1,   1,   1,   0,   0,   0,   0, 
 
    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   1,   1,   1,   1, 
 
    2,   2,   2,   3,   3,   3,   4,   4,   5,   5,   5,   6,   6,   7,   7,   8,   9,   9,  10,  10,  11, 
 
   12,  12,  13,  14,  15,  15,  16,  17,  18,  18,  19,  20,  21,  22,  23,  24,  25,  26,  26,  27,  28, 
 
   29,  30,  31,  33,  34,  35,  36,  37,  38,  39,  40,  41,  43,  44,  45,  46,  47,  49,  50,  51,  52, 
 
   54,  55,  56,  57,  59,  60,  61,  63,  64,  66,  67,  68,  70,  71,  72,  74,  75,  77,  78,  80,  81, 
 
   83,  84,  86,  87,  88,  90,  91,  93,  95,  96,  98,  99, 101, 102, 104, 105, 107, 108, 110, 111, 113, 
 
  115, 116, 118, 119, 121, 122, 124, 125
 
};
 

	
 
static inline uint8_t afsk_read_sample(int phase)
 
{
 
  return pgm_read_byte_near(afsk_sine_table + phase);
 
}
 

	
 
volatile uint16_t phase = 10;
 
volatile uint16_t phasedelta = 3300;
 
extern const uint16_t TABLE_SIZE = sizeof(afsk_sine_table);
 

	
 
// constants
 
#define MODEM_CLOCK_RATE F_CPU
 
#define PLAYBACK_RATE MODEM_CLOCK_RATE / 256  // Fast PWM
 

	
 
#define BAUD_RATE 1200
 
//#define SAMPLES_PER_BAUD PLAYBACK_RATE / BAUD_RATE // = 36
 
//#define SAMPLES_PER_BAUD 36
 
#define SAMPLES_PER_BAUD 36
 

	
 

	
 
// phase offset of 1800 gives ~1900 Hz
 
// phase offset of 3300 gives ~2200 Hz
 
//#define PHASE_DELTA_1200 1800
 
//#define PHASE_DELTA_2200 2200
 
#define PHASE_DELTA_1200 1800
 
#define PHASE_DELTA_2200 2200
 
#define PHASE_DELTA_2200 3300
 

	
 

	
 
// Module globals
 
volatile unsigned char current_byte;
 
volatile unsigned char current_sample_in_baud;    // 1 bit = SAMPLES_PER_BAUD samples
 
volatile bool go = false;                 
 

	
 
volatile unsigned int packet_pos;                 // Next bit to be sent out
 

	
 
volatile unsigned int afsk_packet_size = 10;
 
volatile const uint8_t *afsk_packet;
 

	
 
void afsk_ptt_off() 
 
{
 
	// turn ptt off
 
	PORTA &= ~(1<<PA5);
 
}
 

	
 
void afsk_ptt_on() 
 
{
 
	// turn the ptt on... possibly delay based on spec
 
	PORTA |= (1<<PA5);
 
	_delay_ms(5); // from datasheet
 
}
 

	
 
ISR(TIMER2_OVF_vect) 
 
{
 
	if (go) {
 

	
 
		// If done sending packet
 
		if (packet_pos == afsk_packet_size) 
 
		{
 
			go = false;         // End of transmission
 
			afsk_timer_stop();  // Disable modem
 
			afsk_ptt_off();    // Release PTT
 
			return; // done
 
		}
 

	
 
		// If sent SAMPLES_PER_BAUD already, go to the next bit
 
		if (current_sample_in_baud == 0)  // Load up next bit
 
		{   
 
			if ((packet_pos & 7) == 0) // Load up next byte
 
			{          
 
				current_byte = afsk_packet[packet_pos >> 3];
 
			}				
 
			else 
 
			{
 
				current_byte = current_byte / 2;  // ">>1" forces int conversion
 
			}			
 
@@ -180,52 +183,52 @@ void afsk_start()
 
	current_sample_in_baud = 0;
 
	go = true;
 

	
 
	// Key the radio
 
	afsk_ptt_on();
 

	
 
	// Start transmission
 
	afsk_timer_start();
 
}
 

	
 
int afsk_busy()
 
{
 
	return go;
 
}
 

	
 
void afsk_send(const uint8_t *buffer, int len)
 
{
 
	afsk_packet_size = len;
 
	afsk_packet = buffer;
 
}
 

	
 

	
 
void afsk_setup() 
 
{
 
	
 
	// Source timer2 from clkIO (datasheet p.164)
 
	ASSR &= ~(_BV(EXCLK) | _BV(AS2));
 

	
 
	// Set fast PWM mode with TOP = 0xff: WGM22:0 = 3  (p.150)
 
	TCCR2A |= _BV(WGM21) | _BV(WGM20);
 
	TCCR2B &= ~_BV(WGM22);
 

	
 
	// Do non-inverting PWM on pin OC2A
 
	TCCR2A = (TCCR2A | _BV(COM2A1)) & ~(_BV(COM2A0) | _BV(COM2B1) | _BV(COM2B0));
 

	
 
	// No prescaler (p.162)
 
	TCCR2B = (TCCR2B & ~(_BV(CS22) | _BV(CS21))) | _BV(CS20);
 
	
 
	// Enable interrupt when TCNT2 reaches TOP (0xFF) (p.151, 163)
 
	//TIMSK2 |= _BV(TOIE2);
 
	TIMSK2 |= 0b00000001;
 
	
 
	// FIXME TODO
 
	DDRD = 0xff;
 
	PORTD = 0xff;
 
	
 
	// todo: init radio, maybe in main
 
	
 
	sei();
 
	</i>
 
	
 
	while(afsk_busy());
 
}
 
\ No newline at end of file
master/master/lib/aprs.c
Show inline comments
 
/*
 
 * Master Firmware: APRS
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
#include "../config.h"
 
#include "aprs.h"
 
#include "ax25.h"
 
#include <stdio.h>
 

	
 
const char *gps_aprs_lat = "latitude";
 
const char *gps_aprs_lon = "longitude";
 
const char *gps_time = "gpstime";
 
const char *gps_aprs_lat = "39.74744N";
 
const char *gps_aprs_lon = "-83.81249W";
 
const char *gps_time = "081533/";
 
float gps_altitude = 123.5;
 
int gps_course = 5;
 
int gps_speed = 13;
 

	
 
float meters_to_feet(float m)
 
{
 
  // 10000 ft = 3048 m
 
  return m / 0.3048;
 
}
 

	
 
void aprs_send()
 
{
 
  char temp[12];                   // Temperature (int/ext)
 
  const struct s_address addresses[] = { 
 
    {D_CALLSIGN, D_CALLSIGN_ID},  // Destination callsign
 
    {S_CALLSIGN, S_CALLSIGN_ID},  // Source callsign (-11 = balloon, -9 = car)
 
#ifdef DIGI_PATH1
 
    {DIGI_PATH1, DIGI_PATH1_TTL}, // Digi1 (first digi in the chain)
 
#endif
 
#ifdef DIGI_PATH2
 
    {DIGI_PATH2, DIGI_PATH2_TTL}, // Digi2 (second digi in the chain)
 
#endif
 
  };
 

	
 
	// emz: modified this to get the size of the first address rather than the size of the struct itself, which fails
 
  ax25_send_header(addresses, sizeof(addresses)/sizeof(addresses[0]));
 
  ax25_send_byte('/');                // Report w/ timestamp, no APRS messaging. $ = NMEA raw data
 
  // ax25_send_string("021709z");     // 021709z = 2nd day of the month, 17:09 zulu (UTC/GMT)
 
  ax25_send_string(gps_time);         // 170915 = 17h:09m:15s zulu (not allowed in Status Reports)
 
  ax25_send_byte('h');
 
  ax25_send_string(gps_aprs_lat);     // Lat: 38deg and 22.20 min (.20 are NOT seconds, but 1/100th of minutes)
 
  ax25_send_byte('/');                // Symbol table
 
  ax25_send_string(gps_aprs_lon);     // Lon: 000deg and 25.80 min
 
  ax25_send_byte('O');                // Symbol: O=balloon, -=QTH
 
  snprintf(temp, 4, "%03d", (int)(gps_course + 0.5)); 
 
  ax25_send_string(temp);             // Course (degrees)
 
  ax25_send_byte('/');                // and
 
  snprintf(temp, 4, "%03d", (int)(gps_speed + 0.5));
 
  ax25_send_string(temp);             // speed (knots)
 
  ax25_send_string("/A=");            // Altitude (feet). Goes anywhere in the comment area
 
  snprintf(temp, 7, "%06ld", (long)(meters_to_feet(gps_altitude) + 0.5));
 
  ax25_send_string(temp);
 
  ax25_send_string("/Ti=");
 
  snprintf(temp, 6, "%d", 122);//sensors_int_lm60()); -- PUT SENSOR DATA HERE
 
  ax25_send_string(temp);
 
  ax25_send_string("/Te=");
 
  snprintf(temp, 6, "%d", 123);//sensors_ext_lm60());
 
  ax25_send_string(temp);
master/master/lib/led.c
Show inline comments
 
/*
 
 * Master Firmware: Status and Error LED Handler
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
#include "../config.h"
 
#include <avr/io.h>
 
#include <util/delay.h>
 
#include "led.h"
 
 
// Configure port direction and initial state of LEDs
 
void led_setup() 
 
{
 
	for(int i=0; i<NUM_LEDS; i++)  {
 
		*(ledList[i].direction) |= (1<<ledList[i].pin); // set pin to output
 
		*(ledList[i].port) &= ~(1<<ledList[i].pin); // set pin low
 
	}
 
}
 
 
// Turn the specified LED on
 
void led_on(uint8_t led) 
 
{
 
	*(ledList[led].port) |= (1<<ledList[led].pin);
 
}
 
 
	// Turn the specified LED off
 
void led_off(uint8_t led) 
 
{
 
	*(ledList[led].direction) &= ~(1<<ledList[led].pin);
 
	*(ledList[led].port) &= ~(1<<ledList[led].pin);
 
}
 
 
// Flashes error LED a set amount of times, then leaves it on
 
void led_errorcode(uint8_t code) 
 
{
 
	_delay_ms(400);
 
	for(int i=0; i<code; i++) 
 
	{
 
		led_on(LED_ERROR);
 
		_delay_ms(150);
 
		led_off(LED_ERROR);
 
		_delay_ms(150);
 
	}
 
	_delay_ms(400);
 
	led_on(LED_ERROR);
 
}
 
\ No newline at end of file
master/master/lib/led.h
Show inline comments
 
/*
 
 * Master Firmware: Status and Error LED Handler
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
 
#ifndef LED_H_
 
#define LED_H_
 
 
#include <avr/io.h>
 
 
enum leds {
 
	LED_ACT0 = 0,
 
	LED_ACT1,
 
	LED_ACT2,
 
	LED_ACT3,
 
	
 
	LED_POWER,
 
	LED_STATUS,
 
	LED_ERROR,
 
	LED_SIDEBOARD,
 
	LED_ACTIVITY,
 
	LED_CYCLE
 
	LED_CYCLE,
 
	LED_HEAT
 
};
 
 
typedef struct {uint8_t* direction; uint8_t* port; uint8_t pin;} led_t;
 
 
// Match order of leds enum
 
static led_t ledList[] = {
 
	{&DDRA, &PORTA, PA4}, // ACT0
 
	{&DDRA, &PORTA, PA5}, // ACT1
 
	{&DDRA, &PORTA, PA6}, // ACT2
 
	{&DDRA, &PORTA, PA7}, // ACT3
 
	{&DDRA, &PORTA, PA1}, // ACT0
 
	{&DDRA, &PORTA, PA2}, // ACT1
 
	{&DDRA, &PORTA, PA3}, // ACT2
 
	{&DDRA, &PORTA, PA4}, // ACT3
 
 
//pcb:
 
//	{&DDRB, &PORTB, PB4}, // POWER
 
//	{&DDRB, &PORTB, PB3}, // STATUS
 
//	{&DDRB, &PORTB, PB2}, // ERROR
 
	{&DDRB, &PORTB, PB4}, // POWER
 
	{&DDRB, &PORTB, PB3}, // STATUS
 
	{&DDRB, &PORTB, PB2}, // ERROR
 
 
//breadboard:
 
	{&DDRA, &PORTA, PA2}, // POWER
 
	{&DDRA, &PORTA, PA0}, // STATUS
 
	{&DDRA, &PORTA, PA1}, // ERROR
 
//	{&DDRA, &PORTA, PA2}, // POWER
 
//	{&DDRA, &PORTA, PA0}, // STATUS
 
//	{&DDRA, &PORTA, PA1}, // ERROR
 
 
	{&DDRD, &PORTD, PD6}, // SIDEBOARD
 
	{&DDRD, &PORTD, PD5}, // ACTIVITY
 
	{&DDRD, &PORTD, PD4}, // CYCLE
 
	{&DDRA, &PORTA, PD6}, // HEAT
 
};
 
 
#define NUM_LEDS 10
 
#define NUM_LEDS 11
 
 
void led_setup();
 
void led_on(uint8_t led);
 
void led_off(uint8_t led);
 
void led_errorcode(uint8_t code);
 
 
#endif /* LED_H_ */
master/master/lib/logger.c
Show inline comments
 
/*
 
 * Master Firmware: SD Card Data Logger
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
#include "../config.h"
 
#include <util/delay.h>
 
#include <string.h>
 
#include <stdio.h>
 
#include <avr/pgmspace.h>
 
#include <avr/sleep.h>
 
#include <avr/eeprom.h>
 
#include <string.h>
 
#include "sd/fat.h"
 
#include "sd/fat_config.h"
 
#include "sd/partition.h"
 
#include "sd/sd_raw.h"
 
#include "sd/sd_raw_config.h"
 
#include "logger.h"
 
#include "led.h"
 
 
struct partition_struct* partition;
 
struct fat_fs_struct* fs;
 
struct fat_dir_entry_struct directory;
 
struct fat_dir_struct* dd;
 
struct fat_file_struct* fd;
 
 
void logger_setup()
 
{
 
 
	if(!sd_raw_init())
 
	{
 
		// Initializing SD card failed!
 
		// Error opening partition. MBR might be screwed up.
 
		serial0_sendString("SD: Error initializing.\r\n");
 
		led_errorcode(ERROR_SD_INIT);
 
		return;
 
	}
 
 
	// TODO: Check SD card switch to see if inserted.
 
	// this was included in the library, but is commented out right now
 
	
 
	// Open first partition
 
	partition = partition_open(sd_raw_read, sd_raw_read_interval, sd_raw_write, sd_raw_write_interval, 0);
 
	
 
	// Check that partition was created correctly
 
	if(!partition)
 
	{
 
		serial0_sendString("SD: Error opening partition.\r\n");
 
		// Error opening partition. MBR might be screwed up.
 
		led_errorcode(ERROR_SD_PARTITION);
 
		return;
 
	}
 
	
 
	
 
	// Open FAT filesystem
 
	fs = fat_open(partition);
 
	if(!fs)
 
	{
 
		// opening filesystem failed
 
		return;
 
	}
 
	
 
	// Open directory
 
	fat_get_dir_entry_of_path(fs, "/", &directory);
 

	
 
	dd = fat_open_dir(fs, &directory);
 
	if(!dd)
 
	{
 
		// opening root directory failed
 
		_delay_ms(10);
 
		return;
 
	}
 
	
 
		
 
	// Create new log file
 
	uint8_t logid = eeprom_read_byte(LOGGER_ID_EEPROM_ADDR);
 
	char filename[48];
 
	
 
	// we pre-increment logid here because it starts at 255, then wraps to 0
 
	sprintf(filename, "data%d.csv",++logid);
 
	
 
	// TODO: Catch errors here
 
	fat_create_file(dd, filename, &directory);
 
		
 
	eeprom_update_byte(LOGGER_ID_EEPROM_ADDR, logid);
 

	
 
	// Search for file in current directory and open it
 
	fd = open_file_in_dir(fs, dd, filename);
 
	if(!fd)
 
	{
 
		_delay_ms(10);
 
		return;
 
	}
 
	
 
	// Seek to beginning of file
 
	// TODO: Is this needed?
master/master/lib/serial.c
Show inline comments
 
/*
 
 * Master Firmware: USART Send/Recieve
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
#include "serial.h"
 
#include "led.h"
 
#include "../config.h"
 
#include <avr/io.h>
 
#include <avr/interrupt.h>
 
 
// NOTE: USART ISRs for character reception are included in serparser.c
 
 
void serial0_setup() {
 
	//PORTD &= ~(1<<PD0);
 
	//PORTD |= (1<<PD1);
 
	
 
	/* Enable receiver and transmitter */
 
	UCSR0B |= (1<<RXEN0)|(1<<TXEN0); // Enable rx/tx
 
	/* Set frame format: 8data, 1stop bit */
 
	UCSR0C |= (1 << UCSZ00) | (1 << UCSZ01); // - 1 stop bit
 
	
 
	/* Set baud rate */
 
	UBRR0H = (unsigned char)(USART0_BAUD_PRESCALE>>8);
 
	UBRR0L = (unsigned char)USART0_BAUD_PRESCALE;
 
	
 
	UCSR0B |= (1 << RXCIE0); // Enable interrupt
 
	
 
	//UCSR0A |= (1<<RXC0);
 
}
 
 
volatile uint8_t charTest;
 
 
ISR(USART1_RX_vect)
 
{
 
	serial1_sendChar(UDR1);
 
}
 
 
/*
 
uint8_t test = 0;
 
ISR(USART0__RX_vect)
 
{
 
	led_on(POWER);
 
	test = UDR0;
 
}*/
 
void serial1_setup() {
 
//PROVEN in test project
 
 
void serial1_setup() {
 
	/* Enable receiver and transmitter */
 
	UCSR1B |= (1<<RXEN1)|(1<<TXEN1); // Enable rx/tx
 
	/* Set frame format: 8data, 1stop bit */
 
	UCSR1C |= (1 << UCSZ10) | (1 << UCSZ11); // - 1 stop bit
 
	
 
	/* Set baud rate */
 
	UBRR1H = (unsigned char)(USART1_BAUD_PRESCALE>>8);
 
	UBRR1L = (unsigned char)USART1_BAUD_PRESCALE;
 
	/* Enable receiver and transmitter */
 
	UCSR1B = (1<<RXEN1)|(1<<TXEN1);
 
	/* Set frame format: 8data, 1stop bit */
 
	UCSR1C = (3<<UCSZ10); // - 1 stop bit
 
	
 
	UCSR1B |= (1 << RXCIE1); // Enable interrupt
 
}
 
 
void serial0_sendChar( unsigned char byte )
 
{
 
	while (!(UCSR0A & (1<<UDRE0)));
 
	UDR0 = byte;
 
}
 
 
void serial1_sendChar( unsigned char byte )
 
{
 
	while (!(UCSR1A & (1<<UDRE1)));
 
	UDR1 = byte;
 
}
 
 
unsigned char serial0_readChar()
 
{
 
	while(!(UCSR0A &(1<<RXC0)));
 
	return UDR0;
 
}
 
 
unsigned char serial1_readChar()
 
{
 
	while(!(UCSR1A &(1<<RXC1)));
 
	return UDR1;
 
}
 
 
void serial0_sendString(const char* stringPtr){
 
	while(*stringPtr != 0x00)
 
	{
 
		serial0_sendChar(*stringPtr);
 
		stringPtr++;
 
	}
 
}
 
 
void serial1_sendString(const char* stringPtr){
 
	while(*stringPtr != 0x00)
 
	{
 
		serial1_sendChar(*stringPtr);
 
		stringPtr++;
 
	}
 
}
 
 
 
void serial_sendCommand( char moduleID, char sensorID, char* data )
 
{
 
	char checkSum = 0x00; //initialize checksum
 
	
 
	serial0_sendChar('['); //bracket indicates start of command
 
	serial0_sendChar(moduleID);
 
	checkSum+=moduleID;
 
	
 
	serial0_sendChar(sensorID);
 
	checkSum+=sensorID;
 
	
 
	// send data, null-terminated
 
	while(*data != 0x00)
 
	{
 
		serial0_sendChar(*data);
 
		checkSum += *data;
 
		data++;
 
	}
 
	
 
	
 
	serial0_sendChar(']'); //bracket indicates end of command
 
	serial0_sendChar(checkSum); // checksum moved behind bracket to solve bug FS#29
 
}
 
 
void serial_sendResponseData()
 
{
 
	
 
}
 
master/master/lib/serial.h
Show inline comments
 
/*
 
 * Master Firmware: USART Send/Recieve
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
 
#ifndef SERIAL_H_
 
#define SERIAL_H_
 
 
#include <inttypes.h>
 
 
#define USART0_BAUD_PRESCALE (((F_CPU / (USART0_BAUDRATE * 16UL))) -1 )
 
#define USART1_BAUD_PRESCALE (((F_CPU / (USART1_BAUDRATE * 16UL))) -1 )
 
 
void serial0_sendChar( unsigned char byte );
 
void serial1_sendChar( unsigned char byte );
 
 
unsigned char serial0_readChar();
 
unsigned char serial1_readChar();
 
 
void serial0_setup();
 
void serial1_setup();
 
 
void serial0_sendString(const char* stringPtr);
 
void serial1_sendString(const char* stringPtr);
 
 
void serial_sendCommand( char moduleID, char sensorID, char* data );
 
void serial_sendResponseData();
 
 
 
#endif /* SERIAL_H_ */
 
\ No newline at end of file
master/master/lib/serparser.c
Show inline comments
 
@@ -33,106 +33,108 @@ uint8_t lastParserState = STATE_RESET;
 
 
// Length of current payload data (and checksum)
 
uint8_t payloadLength = 0;
 
 
// Data and checksum of most recent transmission
 
char receivedPayload[MAX_PAYLOAD_LEN];
 
 
// Payload type ID of the sensor of most recent transmission
 
char receivedPayloadType = 0;
 
 
// Checksum to be calculated and then compared to the received checksum
 
char checksumCalc = 0;
 
 
// Accessors
 
uint8_t getPayloadLength() 
 
{
 
	return payloadLength;
 
}
 
uint8_t* getPayload() 
 
{
 
	return receivedPayload;
 
}
 
uint8_t getPayloadType() {
 
	return receivedPayloadType;
 
}
 
 
 
// Could inline if program space available
 
static void setParserState(uint8_t state)
 
{
 
	lastParserState = parserState;
 
	parserState = state;
 
	
 
	// If resetting, clear vars
 
	if(state == STATE_RESET) 
 
	{
 
		payloadLength = 0;
 
		checksumCalc = 0;
 
	}
 
	
 
	// Every time we change state, we have parsed a byte
 
	bufferParsePosition = (bufferParsePosition + 1) % BUFFER_SIZE;
 
}
 
 
// Receive data on USART
 
 
char debugBuff[16];
 
 
ISR(USART0__RX_vect)
 
 
ISR(USART0_RX_vect)
 
{
 
	buffer[bufferDataPosition % BUFFER_SIZE] = UDR0;
 
	bufferDataPosition = (bufferDataPosition + 1) % BUFFER_SIZE;
 
	/*sprintf(debugBuff, "bdp: %d, bpp: %d \r\n", bufferDataPosition, bufferParsePosition);
 
	serial0_sendString((debugBuff)); */
 
	//sprintf(debugBuff, "bdp: %d, bpp: %d \r\n", bufferDataPosition, bufferParsePosition);
 
	//serial0_sendString((debugBuff)); 
 
}
 
 
 
 
 
//#define DEBUG
 
 
// Parse data from circular buffer
 
int serparser_parse(void)
 
{
 
	
 
	char byte;
 
 
	// Process first command (if any) on the circular buffer
 
	while(bufferDataPosition != bufferParsePosition)
 
	{
 
		byte = buffer[bufferParsePosition];
 
		
 
		// Reset 
 
		if(parserState == STATE_RESET)
 
		{
 
			if(byte == '[') // Start of frame; keep parsing
 
			{
 
				#ifdef DEBUG
 
				serial0_sendString("start\r\n");
 
				#endif
 
				setParserState(STATE_GETID);
 
			}
 
			else // Not start of frame, reset
 
			{
 
				#ifdef DEBUG
 
				serial0_sendString("invalid\r\n");
 
				#endif
 
				setParserState(STATE_RESET);
 
				return PARSERESULT_NODATA; // no valid start bit; better luck next time. run the function the next time around the main loop.
 
			}
 
		}
 
		
 
		// Get destination module ID
 
		else if(parserState == STATE_GETID)
 
		{
 
			if(byte == MODULE_ID) // Message intended for this module; keep parsing
 
			{
 
				#ifdef DEBUG
 
				serial0_sendString("dest\r\n");
 
				#endif
 
				checksumCalc += byte;
 
				setParserState(STATE_GETDATATYPE);
 
			}
 
			else // Transmission is intended for another module; reset
 
			{
 
				#ifdef DEBUG
 
				serial0_sendString("bad dest\r\n");
master/master/lib/trackuinoGPS/gpsMKa.c
Show inline comments
 
/*
 
* gpsMKa.c
 
*
 
* Created: 11/15/2012 12:02:38 PM
 
*  Author: mkanning
 
*/
 
 
#include <stdbool.h>
 
#include <avr/io.h>
 
#include "gpsMKa.h"
 
#include "../serial.h"
 

	
 

	
 
// holds the byte ALREADY PARSED. includes starting character
 
int bytesReceived = 0;
 

	
 
//data (and checksum) of most recent transmission
 
char data[16];
 

	
 
//used to skip over bytes during parse
 
int skipBytes = 0;
 

	
 
//used to index data arrays during data collection
 
int numBytes = 0;
 

	
 
//variables to store data from transmission
 
//least significant digit is stored at location 0 of arrays
 
uint8_t tramsmissionType[5];
 
uint8_t timestamp[9];	//hhmmss.ss
 
uint8_t latitude[8];	//lllll.lla
 
uint8_t longitude[8];	//yyyyy.yyb
 
uint8_t quality;		//quality for GGA and validity for RMC
 
uint8_t numSatellites[2];
 
uint8_t hdop[4];		//xx.x
 
uint8_t altitude[8];	//xxxxxx.x
 
uint8_t wgs84Height[6];	//sxxx.x
 
uint8_t lastUpdated[6];	//blank - included for testing
 
uint8_t stationID[6];	//blank - included for testing
 
uint8_t checksum[2];	//xx
 
uint8_t knots[5];		//xxx.xx
 
uint8_t course[5];		//xxx.x
 
uint8_t datestamp[6];	//ddmmyy
 
uint8_t variation[6];	//xxx.xb
 
int calculatedChecksum;
 

	
 
// transmission state machine
 
enum decodeState {
 
	//shared fields
 
	INITIALIZE=0,
 
	GET_TYPE,
 
	GPS_CHECKSUM,	//need to find out how this is calculated/compared
 
	//GGA data fields
 
	GGA_TIME,
 
	GGA_LATITUDE,
 
	GGA_LONGITUDE,
 
	GGA_QUALITY,
 
	GGA_SATELLITES,
 
	GGA_HDOP,
 
	GGA_ALTITUDE,
 
	GGA_WGS84,
 
	GGA_LAST_UPDATE,
 
	GGA_STATION_ID,
 
	//RMC data fields
 
	RMC_TIME,
 
	RMC_VALIDITY,
 
	RMC_LATITUDE,
 
	RMC_LONGITUDE,
 
	RMC_KNOTS,
 
	RMC_COURSE,
 
	RMC_DATE,
 
	RMC_MAG_VARIATION,
 
	
 
}decodeState;
 

	
 

	
 

	
 
//// MKa GPS transmission parser START
 
void parse_gps_transmission(void){
 
	
 
	// Pull byte off of the buffer
 
	char byte = serial1_readChar();
 
	char byte = 'a';// serial1_readChar();
 
	
 
	if(byte == '$') //start of transmission sentence
 
	{
 
		decodeState = GET_TYPE;
 
		numBytes = 0; //prep for next phases
 
		skipBytes = 0;
 
		calculatedChecksum = 0;
 
	}
 
	
 
	//parse transmission type
 
	else if (decodeState == GET_TYPE)
 
	{
 
		tramsmissionType[numBytes] = byte;
 
		numBytes++;
 
		
 
		if(byte == ',') //end of this data type
 
		{
 
			if (tramsmissionType[2] == 'G' &&
 
			tramsmissionType[3] == 'G' &&
 
			tramsmissionType[4] == 'A')
 
			{
 
				decodeState = GGA_TIME;
 
			}
 
			else if (tramsmissionType[2] == 'R' &&
 
			tramsmissionType[3] == 'M' &&
 
			tramsmissionType[4] == 'C')
 
			{
 
				decodeState = RMC_TIME;
 
			}
 
			else //this is an invalid transmission type
 
			{
 
				decodeState = INITIALIZE;
 
			}
 
		}
 
	}
 
	
 
	///parses GGA transmissions START
 
	/// $--GGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*xx
 
	//timestamp
 
	else if (decodeState == GGA_TIME)
 
	{
 
		if (byte == ',') //end of this data type
 
		{
 
			decodeState = GGA_LATITUDE;
 
			skipBytes = 0; //prep for next phase of parse
 
			numBytes = 0;
 
		}
 
		else //store data
master/master/lib/watchdog.c
Show inline comments
 
/*
 
 * Master Firmware: Watchdog Timer
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 
 
 
#include <avr/io.h>
 
#include <avr/interrupt.h>
 
#include <avr/wdt.h>
 
 
//initialize watchdog
 
void watchdog_setup(void)
 
{
 
	
 
	cli();
 
	wdt_reset();
 
	// Set change enable bit, enable the WDT
 
	WDTCSR = (1<<WDCE)|(1<<WDE);
 
	// Start watchdog, 4 second timeout
 
	WDTCSR = (1<<WDE)|(1<<WDP3)|(1<<WDP0);
 
	WDTCSR = (1<<WDE)|(1<<WDP3)|(1<<WDP0);
 
	sei();
 
}
 
 
// ISR for watchdog timeout. Not currently used, interrupt is disabled.
 
ISR(WDT_vect)
 
{
 
	
 
}
master/master/master.c
Show inline comments
 
/*
 
 * Master Firmware
 
 *
 
 * Wireless Observational Modular Aerial Network
 
 * 
 
 * Ethan Zonca
 
 * Matthew Kanning
 
 * Kyle Ripperger
 
 * Matthew Kroening
 
 *
 
 */
 

	
 

	
 
#include "config.h"
 

	
 
#include <avr/io.h>
 
#include <util/delay.h>
 
#include <avr/wdt.h>
 
#include <avr/interrupt.h>
 
#include <stdio.h>
 
#include <stdbool.h>
 

	
 
#include "lib/serial.h"
 
#include "lib/aprs.h"
 
#include "lib/afsk.h"
 
#include "lib/led.h"
 
#include "lib/logger.h"
 
//#include "lib/logger.h"
 
#include "lib/watchdog.h"
 
//!
 
#include "lib/sd/sd_raw_config.h"
 
#include "lib/looptime.h"
 
#include "lib/slavesensors.h"
 
#include "lib/serparser.h"
 
#include "lib/sensordata.h"
 

	
 
void micro_setup() 
 
{
 

	
 
}
 

	
 
int main(void)
 
{
 
    
 
    _delay_ms(1500); // warmup
 
	// Initialize libraries
 
	time_setup();
 
	
 
	micro_setup();
 
	watchdog_setup();
 
	
 
	watchdog_setup(); // enables interrupts
 
	
 
	led_setup();
 
	
 
	serial0_setup();
 
	_delay_ms(10);
 
	
 
	serial1_setup();
 
	
 
	sensordata_setup(); // must happen before sensors/logger/afsk
 
	slavesensors_setup();
 
	logger_setup();
 
	
 
	afsk_setup();
 

	
 
	//serial0_sendString("\r\n\r\n---------------------------------\r\n");
 
	//serial0_sendString("HAB Controller 1.0 - Initialized!\r\n");
 
	//serial0_sendString("---------------------------------\r\n\r\n");
 
	//serial0_sendString("\f\r\n\r\Hello.\r\n\r\n");
 
	serial0_sendString("\r\n\r\n---------------------------------\r\n");
 
	serial0_sendString("HAB Controller 1.0 - Initialized!\r\n");
 
	serial0_sendString("---------------------------------\r\n\r\n");
 
	serial0_sendString("\f\r\n\r\Hello.\r\n\r\n");
 
	
 
	led_on(LED_POWER);
 
	led_off(LED_SIDEBOARD);
 

	
 
	
 
	// Buffer for string operations
 
	char logbuf[16];
 
	
 
	// Software timers	
 
	uint32_t lastAprsBroadcast = 0;
 
	uint32_t lastLog = 0;
 
	uint32_t lastLedCycle = 0;
 
	
 
	// Result of last parser run
 
	int parseResult = PARSERESULT_NODATA;
 
	
 
	// Write CSV header to SD card
 
	//logger_log("ProgramTime,LastAprsBroadcast,LastLog\n");
 
	
 
	uint8_t ctr = 0;
 
	void spin() {
 
		if(ctr == 0) {
 
			led_on(LED_ACT0);
 
			led_off(LED_ACT1);
 
			led_off(LED_ACT2);
 
			led_off(LED_ACT3);
 
		}			
 
		else if (ctr == 1) {
 
			led_on(LED_ACT1);
 
			led_off(LED_ACT0);
 
			led_off(LED_ACT2);
 
			led_off(LED_ACT3);
 
		}			
 
		else if (ctr == 2) {
 
			led_on(LED_ACT2);
 
			led_off(LED_ACT1);
 
			led_off(LED_ACT0);
 
			led_off(LED_ACT3);
 
		}			
 
		else if (ctr == 3) {
 
			led_on(LED_ACT3);
 
			led_off(LED_ACT1);
 
			led_off(LED_ACT2);
 
			led_off(LED_ACT0);
 
		}			
 
		ctr = (ctr + 1) % 4;
 
	}
 
	
 
	while(1)
 
    {
 
		
 
		if(time_millis() - lastLedCycle > LEDCYCLE_RATE) {
 
			spin();
 
			
 
			lastLedCycle = time_millis();	
 
		}
 
		
 
		// Periodic: Logging
 
		if(time_millis() - lastLog > LOGGER_RATE) 
 
		{
 
			led_on(LED_STATUS);
 
			snprintf(logbuf, 16, "%lu,%d,\r\n", time_millis(), sensordata_get(HUMIDITY));
 
			logger_log(logbuf);
 
			//serial0_sendString("Logging: ");
 
			//serial0_sendString(logbuf);
 
			led_off(LED_STATUS);
 
			
 
			lastLog = time_millis();
 
		}		
 
		
 
		
 
		// Periodic: APRS transmission
 
		if(time_millis() - lastAprsBroadcast > APRS_TRANSMIT_PERIOD) 
 
		{
 
			serial0_sendString(":: APRS Periodic\r\n");
 
			
 
			while(afsk_busy());
 
			aprs_send(); // non-blocking
 
			
 
			//serial0_sendString("Initiating APRS transmission...\r\n");
 
			
 
			// Start getting values for next transmission
 
			if(slavesensors_isrequesting())
 
			{
 
				// TODO: something is terribly wrong
 
			}
 
			else 
 
			{				
 
				slavesensors_startprocess();
 
			}
 
			
 
			lastAprsBroadcast = time_millis();
 
		}			
 
		
 

	
 
		parseResult = serparser_parse();
 
		
 

	
 
		slavesensors_process(parseResult);
 

	
 
		wdt_reset();
 
    }
 
}
 
\ No newline at end of file
master/master/master.cproj
Show inline comments
 
<?xml version="1.0" encoding="utf-8"?>
 
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
  <PropertyGroup>
 
    <SchemaVersion>2.0</SchemaVersion>
 
    <ProjectVersion>6.0</ProjectVersion>
 
    <ToolchainName>com.Atmel.AVRGCC8</ToolchainName>
 
    <ProjectGuid>{8579ec2d-5815-40db-84e0-1d14239c7aea}</ProjectGuid>
 
    <avrdevice>ATmega324P</avrdevice>
 
    <avrdevice>ATmega644PA</avrdevice>
 
    <avrdeviceseries>none</avrdeviceseries>
 
    <OutputType>Executable</OutputType>
 
    <Language>C</Language>
 
    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
 
    <OutputFileExtension>.elf</OutputFileExtension>
 
    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
 
    <AssemblyName>master</AssemblyName>
 
    <Name>master</Name>
 
    <RootNamespace>master</RootNamespace>
 
    <ToolchainFlavour>Native</ToolchainFlavour>
 
    <KeepTimersRunning>true</KeepTimersRunning>
 
    <OverrideVtor>false</OverrideVtor>
 
    <OverrideVtorValue />
 
    <eraseonlaunchrule>0</eraseonlaunchrule>
 
    <AsfVersion>3.1.3</AsfVersion>
 
    <avrtool>com.atmel.avrdbg.tool.ispmk2</avrtool>
 
    <avrtoolinterface>ISP</avrtoolinterface>
 
    <com_atmel_avrdbg_tool_simulator>
 
      <ToolType xmlns="">com.atmel.avrdbg.tool.simulator</ToolType>
 
      <ToolName xmlns="">AVR Simulator</ToolName>
 
      <ToolNumber xmlns="">
 
      </ToolNumber>
 
      <KeepTimersRunning xmlns="">true</KeepTimersRunning>
 
      <OverrideVtor xmlns="">false</OverrideVtor>
 
      <OverrideVtorValue xmlns="">
 
      </OverrideVtorValue>
 
      <Channel xmlns="">
 
        <host>127.0.0.1</host>
 
        <port>52692</port>
 
        <ssl>False</ssl>
 
      </Channel>
 
    </com_atmel_avrdbg_tool_simulator>
 
    <com_atmel_avrdbg_tool_ispmk2>
 
      <ToolType>com.atmel.avrdbg.tool.ispmk2</ToolType>
 
      <ToolName>AVRISP mkII</ToolName>
 
      <ToolNumber>000200131077</ToolNumber>
 
      <KeepTimersRunning>true</KeepTimersRunning>
 
      <OverrideVtor>false</OverrideVtor>
 
      <OverrideVtorValue>
 
      </OverrideVtorValue>
 
      <Channel>
 
        <host>127.0.0.1</host>
 
        <port>61309</port>
 
        <port>49512</port>
 
        <ssl>False</ssl>
 
      </Channel>
 
      <ToolOptions>
 
        <InterfaceName>ISP</InterfaceName>
 
        <InterfaceProperties>
 
          <JtagDbgClock>249000</JtagDbgClock>
 
          <JtagProgClock>1000000</JtagProgClock>
 
          <IspClock>2010000</IspClock>
 
          <JtagInChain>false</JtagInChain>
 
          <JtagEnableExtResetOnStartSession>false</JtagEnableExtResetOnStartSession>
 
          <JtagDevicesBefore>0</JtagDevicesBefore>
 
          <JtagDevicesAfter>0</JtagDevicesAfter>
 
          <JtagInstrBitsBefore>0</JtagInstrBitsBefore>
 
          <JtagInstrBitsAfter>0</JtagInstrBitsAfter>
 
        </InterfaceProperties>
 
      </ToolOptions>
 
    </com_atmel_avrdbg_tool_ispmk2>
 
    <preserveEEPROM>True</preserveEEPROM>
 
  </PropertyGroup>
 
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
 
    <ToolchainSettings>
 
      <AvrGcc>
 
        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
 
        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
 
        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
 
        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
 
        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
 
        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
 
        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
 
        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
 
        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
 
        <avrgcc.linker.libraries.Libraries>
 
          <ListValues>
 
            <Value>m</Value>
 
          </ListValues>
 
        </avrgcc.linker.libraries.Libraries>
 
      </AvrGcc>
 
    </ToolchainSettings>
 
  </PropertyGroup>
 
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
 
    <ToolchainSettings>
 
      <AvrGcc>
 
        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
 
        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
 
        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
 
        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
 
        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
 
        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
 
        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
 
        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
 
        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
 
        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
 
        <avrgcc.linker.libraries.Libraries>
 
          <ListValues>
 
            <Value>m</Value>
 
          </ListValues>
 
        </avrgcc.linker.libraries.Libraries>
 
        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
 
      </AvrGcc>
 
    </ToolchainSettings>
 
  </PropertyGroup>
 
  <ItemGroup>
 
    <Compile Include="config.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\afsk.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\afsk.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\aprs.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\aprs.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\ax25.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\ax25.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\logger.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\led.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\led.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\logger.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\logger.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\looptime.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\looptime.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\byteordering.c">
 
    <Compile Include="lib\SDa\byteordering.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\byteordering.h">
 
    <Compile Include="lib\SDa\byteordering.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\fat.c">
 
    <Compile Include="lib\SDa\fat.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\fat.h">
 
    <Compile Include="lib\SDa\fat.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\fat_config.h">
 
    <Compile Include="lib\SDa\fat_config.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\partition.c">
 
    <Compile Include="lib\SDa\partition.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\partition.h">
 
    <Compile Include="lib\SDa\partition.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\partition_config.h">
 
    <Compile Include="lib\SDa\partition_config.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\sd-reader_config.h">
 
    <Compile Include="lib\SDa\sd-reader_config.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\sd_raw.c">
 
    <Compile Include="lib\SDa\sd_raw.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\sd_raw.h">
 
    <Compile Include="lib\SDa\sd_raw.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sd\sd_raw_config.h">
 
    <Compile Include="lib\SDa\sd_raw_config.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sensordata.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\sensordata.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\serial.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\serial.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\serparser.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\serparser.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\slavesensors.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\slavesensors.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\trackuinoGPS\config.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\trackuinoGPS\gpsMKa.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\trackuinoGPS\gpsMKa.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\watchdog.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\watchdog.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="master.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
  </ItemGroup>
 
  <ItemGroup>
 
    <Folder Include="lib" />
 
    <Folder Include="lib\SDa" />
 
    <Folder Include="lib\trackuinoGPS" />
 
    <Folder Include="lib\sd" />
 
  </ItemGroup>
 
  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
 
</Project>
 
\ No newline at end of file
0 comments (0 inline, 0 general)