Subversion Repositories Projects

Rev

Rev 507 | Rev 523 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 507 Rev 514
Line 35... Line 35...
35
#include "osd_helpers.h"
35
#include "osd_helpers.h"
36
#include "config.h"
36
#include "config.h"
37
#include "spi.h"
37
#include "spi.h"
38
#include "buttons.h"
38
#include "buttons.h"
39
#include "ppm.h"
39
#include "ppm.h"
40
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
-
 
41
#include "osd_ncmode_default.h"
40
#include "osd_ncmode_default.h"
42
#include "osd_ncmode_minimal.h"
41
#include "osd_ncmode_minimal.h"
43
#include "osd_fcmode_default.h"
42
#include "osd_fcmode_default.h"
-
 
43
 
-
 
44
#if WRITECHARS != -1
-
 
45
#include "characters.h"
44
#endif
46
#endif
Line 45... Line 47...
45
 
47
 
46
/* TODO:
48
/* TODO:
47
 * - verifiy correctness of values
49
 * - verifiy correctness of values
Line 79... Line 81...
79
uint8_t max_voltage = 0;
81
uint8_t max_voltage = 0;
Line 80... Line 82...
80
 
82
 
81
// Flags
83
// Flags
Line -... Line 84...
-
 
84
uint8_t COSD_FLAGS = 0, COSD_FLAGS2 = 0;
-
 
85
 
82
uint8_t COSD_FLAGS = 0, COSD_FLAGS2 = 0;
86
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
83
 
87
 
84
// stats for after flight
88
// stats for after flight
85
int16_t max_Altimeter = 0;
89
int16_t max_Altimeter = 0;
86
uint8_t min_UBat = 255;
90
uint8_t min_UBat = 255;
Line 124... Line 128...
124
        str_N};
128
        str_N};
Line 125... Line 129...
125
 
129
 
126
/* ##########################################################################
130
/* ##########################################################################
127
 * Different display mode function pointers
131
 * Different display mode function pointers
128
 * ##########################################################################*/
-
 
129
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
132
 * ##########################################################################*/
130
const char str_1[] PROGMEM  = "default";
133
const char str_1[] PROGMEM  = "default";
Line 131... Line 134...
131
const char str_2[] PROGMEM  = "minimal";
134
const char str_2[] PROGMEM  = "minimal";
132
 
135
 
Line 184... Line 187...
184
 
187
 
185
/* ##########################################################################
188
/* ##########################################################################
186
 * MAIN
189
 * MAIN
187
 * ##########################################################################*/
190
 * ##########################################################################*/
-
 
191
int main(void) {
-
 
192
        // set up FLAGS
-
 
193
        COSD_FLAGS = 0;
-
 
194
        #if NTSC
-
 
195
        COSD_FLAGS |= COSD_FLAG_NTSC;
-
 
196
        #endif
-
 
197
        #if HUD
-
 
198
        COSD_FLAGS |= COSD_FLAG_HUD;
-
 
199
        #endif
-
 
200
        #if ARTHORIZON
-
 
201
        COSD_FLAGS |= COSD_FLAG_ARTHORIZON;
-
 
202
        #endif
-
 
203
        #if BIGVARIO
-
 
204
        COSD_FLAGS |= COSD_FLAG_BIGARIO;
-
 
205
        #endif
-
 
206
        #if STATS
-
 
207
        COSD_FLAGS |= COSD_FLAG_STATS;
-
 
208
        #endif
-
 
209
        #if WARNINGS
-
 
210
        COSD_FLAGS |= COSD_FLAG_WARNINGS;
-
 
211
        #endif
-
 
212
        #if FCONLY
-
 
213
        COSD_FLAGS |= COSD_FLAG_FCMODE;
-
 
214
        #endif
Line 188... Line -...
188
int main(void) {
-
 
189
 
-
 
190
    // set up FLAGS, compiler should flatten this one
-
 
191
    COSD_FLAGS = (NTSC << 0);
-
 
192
    COSD_FLAGS |= (HUD << 1);
-
 
193
    COSD_FLAGS |= (ARTHORIZON << 2);
-
 
194
    COSD_FLAGS |= (BIGVARIO << 3);
-
 
Line 195... Line 215...
195
    COSD_FLAGS |= (STATS << 4);
215
 
196
    COSD_FLAGS |= (WARNINGS << 5);
216
 
197
 
217
 
198
    // set up Atmega162 Ports
218
    // set up Atmega162 Ports
Line 230... Line 250...
230
 
250
 
231
    //Pushing NEW chars to the MAX7456
251
    //Pushing NEW chars to the MAX7456
232
#if (WRITECHARS != -1)
252
#if (WRITECHARS != -1)
233
        // DISABLE display (VM0)
253
        // DISABLE display (VM0)
234
        spi_send_byte(0x00, 0b00000000);
254
        spi_send_byte(0x00, 0b00000000);
235
#include "characters.c"
255
        learn_all_chars_pgm();
236
#else
256
#else
237
        // read out config for NTSC/PAL distinguishing
257
        // read out config for NTSC/PAL distinguishing
238
        get_eeprom(0);
258
        get_eeprom(0);
Line 297... Line 317...
297
    // we are ready
317
    // we are ready
298
    LED3_ON
318
    LED3_ON
Line 299... Line 319...
299
 
319
 
300
#if ALLCHARSDEBUG | (WRITECHARS != -1)
320
#if ALLCHARSDEBUG | (WRITECHARS != -1)
301
        clear();
321
        clear();
302
    write_all_chars();
322
        write_all_chars();
303
        LED1_ON
323
        LED1_ON
304
        LED2_ON
324
        LED2_ON
305
        LED3_ON
325
        LED3_ON
306
        LED4_ON
326
        LED4_ON