Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1199 - 1
/****************************************************************************
2
 *   Copyright (C) 2011 by Claas Anders "CaScAdE" Rathje                    *
3
 *   admiralcascade@gmail.com                                               *
4
 *   Project-URL: http://www.mylifesucks.de/oss/c-epilepsy/                 *
5
 *                                                                          *
6
 *   This program is free software; you can redistribute it and/or modify   *
7
 *   it under the terms of the GNU General Public License as published by   *
8
 *   the Free Software Foundation; either version 2 of the License.         *
9
 *                                                                          *
10
 *   This program is distributed in the hope that it will be useful,        *
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
13
 *   GNU General Public License for more details.                           *
14
 *                                                                          *
15
 *   You should have received a copy of the GNU General Public License      *
16
 *   along with this program; if not, write to the                          *
17
 *   Free Software Foundation, Inc.,                                        *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
19
 ****************************************************************************/
20
 
21
#ifndef _MAIN_H
22
#define _MAIN_H
23
 
24
 
25
#ifndef MCU
26
#define MCU atmega644p
27
//#ifndef __AVR_ATmega644P__
28
//#define __AVR_ATmega644P__
29
//#endif
30
#endif
31
 
32
#define EPI10AQ41       01 /* the grey one done by akku by hand */
33
#define EPI10           10
34
#define EPI11           11
35
 
36
//#define HWVERSION HW_10AQ41
37
 
38
#ifndef HWVERSION
39
#define HWVERSION EPI11
40
#endif
41
 
42
#if HWVERSION == EPI10AQ41
43
 
44
#define LEDGREEN_ON             PORTB |=  (1 << PB1);
45
#define LEDGREEN_OFF            PORTB &= ~(1 << PB1);
46
#define LEDGREEN_TOGGLE         PORTB ^=  (1 << PB1);
47
#define LEDRED_ON               PORTB |=  (1 << PB2);
48
#define LEDRED_OFF              PORTB &= ~(1 << PB2);
49
#define LEDRED_TOGGLE           PORTB ^=  (1 << PB2);
50
 
51
#elif HWVERSION == EPI10
52
 
53
#define LEDGREEN_ON             PORTD |=  (1 << PD7);
54
#define LEDGREEN_OFF            PORTD &= ~(1 << PD7);
55
#define LEDGREEN_TOGGLE         PORTD ^=  (1 << PD7);
56
#define LEDRED_ON               PORTD |=  (1 << PD3);
57
#define LEDRED_OFF              PORTD &= ~(1 << PD3);
58
#define LEDRED_TOGGLE           PORTD ^=  (1 << PD3);
59
 
60
#else 
61
 
62
#define LEDGREEN_ON             PORTD |=  (1 << PD7);
63
#define LEDGREEN_OFF            PORTD &= ~(1 << PD7);
64
#define LEDGREEN_TOGGLE         PORTD ^=  (1 << PD7);
65
#define LEDRED_ON               PORTD &= ~(1 << PD7);
66
#define LEDRED_OFF              PORTD |=  (1 << PD7);
67
#define LEDRED_TOGGLE           PORTD ^=  (1 << PD7);
68
 
69
#endif
70
 
71
 
72
#include <avr/eeprom.h>
73
#include <avr/io.h>
74
#include <avr/interrupt.h>
75
#include <avr/pgmspace.h>
76
#include <avr/wdt.h>
77
#include <inttypes.h>
78
//#include <math.h>
79
#include <stdint.h> 
80
#include <stdlib.h>
81
#include <util/delay.h>
82
#include <string.h>
83
#include "timer0.h"
84
#include "timer1.h"
85
#include "led_out.h"
86
#include "player.h"
87
#include "usart0.h"
88
#include "usart1.h"
89
#include "mk-data-structs.h"
90
#include "epi_helpers.h"
91
#include "integer_math.h"
92
#include "nc_handler.h"
93
#include "buttons.h"
94
#include "eeprom.h"
95
 
96
#ifndef BUILDDATE
97
#define BUILDDATE "DEVEL-BUILD" // build date, this is testing...
98
#endif
99
 
100
#ifndef FCONLY
101
#define FCONLY 0                // set to 1 if you do NOT have a NaviCtrl and the Epilepsy is
102
#endif                          // connected to the FC directly
103
 
104
 
105
extern const uint8_t COLORS [][6];
106
extern uint8_t main_mode;
107
extern volatile uint8_t CEPILEPSYFLAGS;
108
 
109
#define CEPI_DIRTYEEPROM 1
110
 
111
 
112
#endif