Subversion Repositories Projects

Rev

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

Rev 800 Rev 826
Line 99... Line 99...
99
// flags from last round to check for changes
99
// flags from last round to check for changes
100
uint8_t old_MKFlags = 0;
100
uint8_t old_MKFlags = 0;
Line 101... Line 101...
101
 
101
 
102
// store stats description in progmem to save space
102
// store stats description in progmem to save space
103
const char stats_item_0[] PROGMEM = "max Altitude:";
103
const char stats_item_0[] PROGMEM = "max Altitude:";
104
const char stats_item_1[] PROGMEM = "max Speed   :";
104
const char stats_item_1[] PROGMEM = "max Speed :";
105
const char stats_item_2[] PROGMEM = "max Distance:";
105
const char stats_item_2[] PROGMEM = "max Distance:";
106
const char stats_item_3[] PROGMEM = "min Voltage :";
106
const char stats_item_3[] PROGMEM = "min Voltage :";
107
const char stats_item_4[] PROGMEM = "max Time    :";
107
const char stats_item_4[] PROGMEM = "max Time:";
108
const char stats_item_5[] PROGMEM = "longitude   :";
108
const char stats_item_5[] PROGMEM = "longitude :";
109
const char stats_item_6[] PROGMEM = "latitude    :";
109
const char stats_item_6[] PROGMEM = "latitude:";
110
const char stats_item_7[] PROGMEM = "max current :";
110
const char stats_item_7[] PROGMEM = "max current :";
111
const char *stats_item_pointers[8] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
111
const char *stats_item_pointers[8] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
Line 112... Line 112...
112
    stats_item_3, stats_item_4, stats_item_5, stats_item_6, stats_item_7};
112
    stats_item_3, stats_item_4, stats_item_5, stats_item_6, stats_item_7};
Line 135... Line 135...
135
/* ##########################################################################
135
/* ##########################################################################
136
 * Different display mode function pointers
136
 * Different display mode function pointers
137
 * ##########################################################################*/
137
 * ##########################################################################*/
138
const char str_1[] PROGMEM = "default";
138
const char str_1[] PROGMEM = "default";
139
const char str_2[] PROGMEM = "minimal";
139
const char str_2[] PROGMEM = "minimal";
140
const char str_3[] PROGMEM = "   jopl";
140
const char str_3[] PROGMEM = " jopl";
Line 141... Line 141...
141
 
141
 
142
#if FCONLY
142
#if FCONLY
143
const displaymode_t fcdisplaymodes[] PROGMEM = {
143
const displaymode_t fcdisplaymodes[] PROGMEM = {
144
    { osd_fcmode_default, (char *)str_1},
144
    { osd_fcmode_default, (char *)str_1},
Line 231... Line 231...
231
    COSD_FLAGS_CONFIG |= COSD_FLAG_FCMODE;
231
    COSD_FLAGS_CONFIG |= COSD_FLAG_FCMODE;
232
#endif
232
#endif
Line 233... Line 233...
233
 
233
 
234
 
234
 
235
    // set up Atmega162 Ports
235
    // set up Atmega162 Ports
236
    DDRA |= ((1 << PA1) | (1 << PA2) | (1 << PA3) | (1 << PA5)); // PA1 output (/CS) | PA2 output (SDIN) |  PA3 output (SCLK) | PA5 output (RESET)
236
    DDRA |= ((1 << PA1) | (1 << PA2) | (1 << PA3) | (1 << PA5)); // PA1 output (/CS) | PA2 output (SDIN) |PA3 output (SCLK) | PA5 output (RESET)
237
    MAX_CS_HIGH
237
    MAX_CS_HIGH
238
    MAX_SDIN_LOW
238
    MAX_SDIN_LOW
Line 243... Line 243...
243
    LED1_OFF
243
    LED1_OFF
244
    LED2_OFF
244
    LED2_OFF
245
    LED3_OFF
245
    LED3_OFF
246
    LED4_OFF
246
    LED4_OFF
Line 247... Line 247...
247
 
247
 
248
    DDRC &= ~((1 << PC4) | (1 << PC5)); // PC4 input  (MODE) | PC5 input  (SET)
248
    DDRC &= ~((1 << PC4) | (1 << PC5)); // PC4 input(MODE) | PC5 input(SET)
Line 249... Line 249...
249
    PORTC |= ((1 << PC4) | (1 << PC5)); // pullup
249
    PORTC |= ((1 << PC4) | (1 << PC5)); // pullup
250
 
250
 
251
    // reset the MAX7456 to be sure any undefined states do no harm
251
    // reset the MAX7456 to be sure any undefined states do no harm
Line 325... Line 325...
325
 
325
 
326
    // enable interrupts
326
    // enable interrupts
Line 327... Line 327...
327
    sei();
327
    sei();
328
 
328
 
329
 
329
 
Line 330... Line 330...
330
    //write_ascii_string(2,  7, "         CaScAdE          ");
330
    //write_ascii_string(2,7, " CaScAdE");
331
    //write_ascii_string(2,  8, "is TESTING his open source");
331
    //write_ascii_string(2,8, "is TESTING his open source");
Line 332... Line 332...
332
    //write_ascii_string(2,  9, "    EPi OSD Firmware");
332
    //write_ascii_string(2,9, "EPi OSD Firmware");
333
 
333
 
Line -... Line 334...
-
 
334
    // we are ready
334
    // we are ready
335
    LED3_ON
335
    LED3_ON
336
 
336
 
337
 
Line 337... Line 338...
337
 
338
    // clear serial screen
338
    // clear serial screen
339
    //usart1_puts("\x1B[2J\x1B[H");
339
    //usart1_puts("\x1B[2J\x1B[H");
340
 
Line 403... Line 404...
403
            }
404
            }
404
#endif
405
#endif
Line 405... Line 406...
405
 
406
 
406
            // ONLY FOR TESTING
407
            // ONLY FOR TESTING
407
#ifdef ANTENNATRACKTEST 
408
#ifdef ANTENNATRACKTEST 
408
            #include <stdlib.h>
409
#include <stdlib.h>
409
            //#include <float.h>
410
            //#include <float.h>
Line 410... Line 411...
410
            //#include <math.h>
411
            //#include <math.h>
Line 441... Line 442...
441
        }
442
        }
442
        // handle keypress
443
        // handle keypress
443
        if (s1_pressed()) {
444
        if (s1_pressed()) {
444
            config_menu();
445
            config_menu();
445
        }
446
        }
-
 
447
        // reqest data untill there has been some answer
-
 
448
        if (!(COSD_FLAGS_RUNTIME & COSD_DATARECEIVED) ||
446
        if (seconds_since_last_data > 0) {
449
            // or while not in passive mode
-
 
450
            (seconds_since_last_data > 0 && !(COSD_FLAGS_CONFIG & COSD_FLAG_PASSIVE))) {
447
            usart1_EnableTXD();
451
            usart1_EnableTXD();
448
            //usart1_puts_pgm(PSTR("zu alt\r\n"));
452
            //usart1_puts_pgm(PSTR("zu alt\r\n"));
449
#if FCONLY
453
#if FCONLY
450
            // request data ever 100ms from FC;
454
            // request data ever 100ms from FC;
451
            //usart1_request_mk_data(0, 'd', 100);
455
            //usart1_request_mk_data(0, 'd', 100);