Subversion Repositories Projects

Rev

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

Rev Author Line No. Line
346 cascade 1
/****************************************************************************
2
 *   Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje                    *
3
 *   admiralcascade@gmail.com                                               *
4
 *   Project-URL: http://www.mylifesucks.de/oss/c-osd/                      *
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
/* ##########################################################################
22
 * Debugging and general purpose definitions
23
 * ##########################################################################*/
24
#define ALLCHARSDEBUG 0         // set to 1 and flash firmware to see all chars
25
 
26
#ifndef WRITECHARS                      // if WRITECHARS not set via makefile
27
#define WRITECHARS -1           // set to 2XX and flash firmware to write new char
28
                                                        // enables the allchars as well to see results
29
#endif
30
 
31
#ifndef NTSC                            // if NTSC is not thet via makefile
32
#define NTSC 0                          // set to 1 for NTSC mode + lifts the bottom line
33
#endif
34
 
35
#define HUD 1                           // set to 0 to disable HUD by default
36
#define ARTHORIZON 0            // set to 1 to enable roll&nick artificial horizon by default
37
#define STATS 1                         // set to 1 to enable statistics during motor off by default
38
#define WARNINGS 1                      // set to 1 to display battery+rc warning even if HUD is disabled
39
 
40
#define UBAT_WRN 94                     // voltage for blinking warning, like FC settings
41
#define RCLVL_WRN 100           // make the RC level blink if below this number
42
 
43
// ### read datasheet before changing stuff below this line :)
44
#define BLINK   0b01001111      // attribute byte for blinking chars
45
 
46
/* ##########################################################################
47
 * FLAGS usable during runtime
48
 * ##########################################################################*/
49
#define COSD_FLAG_NTSC                   1
50
#define COSD_FLAG_HUD                    2
51
#define COSD_FLAG_ARTHORIZON     4
52
#define COSD_FLAG_STATS                  8
53
#define COSD_FLAG_WARNINGS              16
54
#define COSD_ICONS_WRITTEN              32
55
 
56
/* ##########################################################################
57
 * LED controll
58
 * ##########################################################################*/
59
#define LED1_ON                 PORTC |=  (1 << PC0);
60
#define LED1_OFF                PORTC &= ~(1 << PC0);
61
#define LED2_ON                 PORTC |=  (1 << PC1);
62
#define LED2_OFF                PORTC &= ~(1 << PC1);
63
#define LED3_ON                 PORTC |=  (1 << PC2);
64
#define LED3_OFF                PORTC &= ~(1 << PC2);
65
#define LED4_ON                 PORTC |=  (1 << PC3);
66
#define LED4_OFF                PORTC &= ~(1 << PC3);
67
 
68
/* ##########################################################################
69
 * switch controll
70
 * ##########################################################################*/
71
#define S1_PRESSED              !(PINC & (1<<PC5))
72
#define S2_PRESSED              !(PINC & (1<<PC4))
73