Rev 495 | Rev 499 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 495 | Rev 497 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | * along with this program; if not, write to the * |
16 | * along with this program; if not, write to the * |
17 | * Free Software Foundation, Inc., * |
17 | * Free Software Foundation, Inc., * |
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 | ****************************************************************************/ |
19 | ****************************************************************************/ |
Line -... | Line 20... | ||
- | 20 | ||
- | 21 | #include <avr/pgmspace.h> |
|
- | 22 | #include "mk-data-structs.h" |
|
20 | 23 | ||
21 | /* ########################################################################## |
24 | /* ########################################################################## |
22 | * Debugging and general purpose definitions |
25 | * Debugging and general purpose definitions |
23 | * ##########################################################################*/ |
26 | * ##########################################################################*/ |
24 | #ifndef BUILDDATE |
27 | #ifndef BUILDDATE |
Line 40... | Line 43... | ||
40 | #endif |
43 | #endif |
Line 41... | Line 44... | ||
41 | 44 | ||
42 | #ifndef FCONLY |
45 | #ifndef FCONLY |
43 | #define FCONLY 0 // set to 1 if you do NOT have a NaviCtrl and the OSD is |
46 | #define FCONLY 0 // set to 1 if you do NOT have a NaviCtrl and the OSD is |
44 | #endif // connected to the FC directly |
- | |
45 | - | ||
46 | #ifndef OSD_FCMODE // set up which FCMODE to display if doing batch generating |
- | |
47 | #define OSD_FCMODE "osd_fcmode_default.c" // default is a nice standard |
- | |
48 | #endif |
- | |
49 | - | ||
50 | #ifndef OSD_NCMODE // set up which NCMODE to display if doing batch generating |
- | |
51 | #define OSD_NCMODE "osd_ncmode_default.c" // default is a nice standard |
- | |
Line 52... | Line 47... | ||
52 | #endif |
47 | #endif // connected to the FC directly |
53 | 48 | ||
54 | #define HUD 1 // set to 0 to disable HUD by default |
49 | #define HUD 1 // set to 0 to disable HUD by default |
55 | #define ARTHORIZON 0 // set to 1 to enable roll&nick artificial horizon by default |
50 | #define ARTHORIZON 0 // set to 1 to enable roll&nick artificial horizon by default |
56 | #define BIGVARIO 0 // set to 1 to enable the big vario bar on right side |
51 | #define BIGVARIO 0 // set to 1 to enable the big vario bar on right side |
Line 110... | Line 105... | ||
110 | extern volatile unsigned char spi_cmd_buffer[]; |
105 | extern volatile unsigned char spi_cmd_buffer[]; |
111 | extern volatile uint8_t spi_ready; |
106 | extern volatile uint8_t spi_ready; |
112 | extern int16_t ampere, max_ampere; |
107 | extern int16_t ampere, max_ampere; |
113 | extern int32_t ampere_wasted; |
108 | extern int32_t ampere_wasted; |
Line -... | Line 109... | ||
- | 109 | ||
- | 110 | /* ########################################################################## |
|
- | 111 | * struct for displaymodes |
|
- | 112 | * ##########################################################################*/ |
|
- | 113 | typedef struct { |
|
- | 114 | int (*dfun)(void); // function pointer |
|
- | 115 | char *desc; // description text |
|
- | 116 | } displaymode_t; |
|
- | 117 | ||
- | 118 | const displaymode_t ncdisplaymodes[2]; |
|
- | 119 | const displaymode_t fcdisplaymodes[1]; |
|
- | 120 | ||
- | 121 | int (*osd_ncmode)(void); |
|
- | 122 | int (*osd_fcmode)(void); |
|
- | 123 | ||
- | 124 | /* ########################################################################## |
|
- | 125 | * vars used by other parts as well |
|
- | 126 | * ##########################################################################*/ |
|
- | 127 | volatile uint16_t setsReceived; |
|
- | 128 | ||
- | 129 | volatile NaviData_t naviData; |
|
- | 130 | volatile DebugOut_t debugData; |
|
- | 131 | ||
- | 132 | // cache old vars for blinking attribute, checkup is faster than full |
|
- | 133 | // attribute write each time |
|
- | 134 | volatile uint8_t last_UBat; |
|
- | 135 | volatile uint8_t last_RC_Quality; |
|
- | 136 | ||
- | 137 | // 16bit should be enough, normal LiPos don't last that long |
|
- | 138 | volatile uint16_t uptime; |
|
- | 139 | volatile uint16_t timer; |
|
- | 140 | ||
- | 141 | // remember last time data was received |
|
- | 142 | volatile uint8_t seconds_since_last_data; |
|
- | 143 | ||
- | 144 | // general PAL|NTSC distingiusch stuff |
|
- | 145 | uint8_t top_line; |
|
- | 146 | uint8_t bottom_line; |
|
- | 147 | ||
- | 148 | // battery voltages |
|
- | 149 | uint8_t min_voltage; |
|
- | 150 | uint8_t max_voltage; |
|
- | 151 | ||
- | 152 | // Flags |
|
- | 153 | uint8_t COSD_FLAGS, COSD_FLAGS2, COSD_DISPLAYMODE; |
|
- | 154 | ||
- | 155 | // stats for after flight |
|
- | 156 | int16_t max_Altimeter; |
|
- | 157 | uint8_t min_UBat; |
|
- | 158 | ||
- | 159 | uint16_t max_GroundSpeed; |
|
- | 160 | int16_t max_Distance; |
|
- | 161 | uint16_t max_FlyingTime; |
|
- | 162 | ||
- | 163 | // flags from last round to check for changes |
|
- | 164 | uint8_t old_MKFlags; |
|
- | 165 | ||
- | 166 | const char *directions[8]; |