Subversion Repositories Projects

Rev

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

Rev 761 Rev 762
Line 53... Line 53...
53
 
53
 
54
 
54
 
55
/* ##########################################################################
55
/* ##########################################################################
56
 * global definitions and global vars
56
 * global definitions and global vars
57
 * ##########################################################################*/
57
 * ##########################################################################*/
-
 
58
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
58
 
59
 
59
volatile NaviData_t naviData;
60
volatile NaviData_t naviData;
60
volatile DebugOut_t debugData;
61
volatile DebugOut_t debugData;
61
 
62
 
62
// cache old vars for blinking attribute, checkup is faster than full
63
// cache old vars for blinking attribute, checkup is faster than full
Line 81... Line 82...
81
uint8_t max_voltage = 0;
82
uint8_t max_voltage = 0;
82
 
83
 
83
// Flags
84
// Flags
84
uint8_t COSD_FLAGS_MODES = 0, COSD_FLAGS_CONFIG = 0, COSD_FLAGS_RUNTIME = 0, COSD_DISPLAYMODE = 0;
85
uint8_t COSD_FLAGS_MODES = 0, COSD_FLAGS_CONFIG = 0, COSD_FLAGS_RUNTIME = 0, COSD_DISPLAYMODE = 0;
85
 
86
 
86
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
-
 
-
 
87
 
87
 
88
 
88
// stats for after flight
89
// stats for after flight
89
int16_t max_Altimeter = 0;
90
int16_t max_Altimeter = 0;
90
uint8_t min_UBat = 255;
91
uint8_t min_UBat = 255;
91
uint16_t max_GroundSpeed = 0;
92
uint16_t max_GroundSpeed = 0;
Line 191... Line 192...
191
            delay_spi = 8;
192
            delay_spi = 8;
192
            spi_send_next();
193
            spi_send_next();
193
        }
194
        }
194
    }
195
    }
195
}
196
}
196
#endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1))#endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1))
197
#endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1))
197
 
198
 
198
/* ##########################################################################
199
/* ##########################################################################
199
 * MAIN
200
 * MAIN
200
 * ##########################################################################*/
201
 * ##########################################################################*/
201
int main(void) {
202
int main(void) {
Line 317... Line 318...
317
    // PPM detection setup
318
    // PPM detection setup
318
    ppm_init();
319
    ppm_init();
319
 
320
 
320
    // enable interrupts
321
    // enable interrupts
321
    sei();
322
    sei();
322
#endif
323
 
323
 
324
 
324
    //write_ascii_string(2,  7, "         CaScAdE          ");
325
    //write_ascii_string(2,  7, "         CaScAdE          ");
325
    //write_ascii_string(2,  8, "is TESTING his open source");
326
    //write_ascii_string(2,  8, "is TESTING his open source");
326
    //write_ascii_string(2,  9, "    EPi OSD Firmware");
327
    //write_ascii_string(2,  9, "    EPi OSD Firmware");
327
 
328
 
328
    // we are ready
329
    // we are ready
329
    LED3_ON
330
    LED3_ON
330
 
331
 
331
#if ALLCHARSDEBUG | (WRITECHARS != -1)
-
 
332
        clear();
-
 
333
    write_all_chars();
-
 
334
    LED1_ON
-
 
335
    LED2_ON
-
 
336
    LED3_ON
-
 
337
    LED4_ON
-
 
338
#else
-
 
339
 
332
 
340
        // clear serial screen
333
    // clear serial screen
341
        //usart1_puts("\x1B[2J\x1B[H");
334
    //usart1_puts("\x1B[2J\x1B[H");
342
        //usart1_puts("hello world!123\r\n");
-
 
343
 
335
 
344
    while (1) {
336
    while (1) {
345
        // in case SPI is ready and there is nothing to send right now
337
        // in case SPI is ready and there is nothing to send right now
346
        if (!icnt && spi_ready) {
338
        if (!icnt && spi_ready) {
347
            // correct transfer ends with d (done)
339
            // correct transfer ends with d (done)
Line 425... Line 417...
425
            // reset last time counter
417
            // reset last time counter
426
            seconds_since_last_data = 0;
418
            seconds_since_last_data = 0;
427
            usart1_DisableTXD();
419
            usart1_DisableTXD();
428
        }
420
        }
429
    }
421
    }
-
 
422
 
-
 
423
#else // character flashing...
-
 
424
        clear();
-
 
425
    write_all_chars();
-
 
426
    LED1_ON
-
 
427
    LED2_ON
-
 
428
    LED3_ON
-
 
429
    LED4_ON
-
 
430
        while(1) {
-
 
431
 
-
 
432
        };
430
#endif
433
#endif
-
 
434
 
-
 
435
 
431
    return 0;
436
    return 0;
432
}
437
}