Subversion Repositories Projects

Rev

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

Rev 772 Rev 783
Line 59... Line 59...
59
 * global definitions and global vars
59
 * global definitions and global vars
60
 * ##########################################################################*/
60
 * ##########################################################################*/
61
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
61
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
62
 
62
 
63
volatile NaviData_t naviData;
63
volatile NaviData_t naviData;
64
volatile DebugOut_t debugData;
64
volatile str_DebugOut debugData;
65
 
65
 
66
// cache old vars for blinking attribute, checkup is faster than full
66
// cache old vars for blinking attribute, checkup is faster than full
67
// attribute write each time
67
// attribute write each time
68
volatile uint8_t last_UBat = 255;
68
volatile uint8_t last_UBat = 255;
69
volatile uint8_t last_RC_Quality = 255;
69
volatile uint8_t last_RC_Quality = 255;
Line 137... Line 137...
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";
141
 
141
 
142
const displaymode_t ncdisplaymodes[] PROGMEM = {
-
 
143
    { osd_ncmode_default, (char *)str_1},
-
 
144
    { osd_ncmode_minimal, (char *)str_2}
-
 
145
};
142
#if FCONLY
146
 
-
 
147
const displaymode_t fcdisplaymodes[] PROGMEM = {
143
const displaymode_t fcdisplaymodes[] PROGMEM = {
148
    { osd_fcmode_default, (char *)str_1},
144
    { osd_fcmode_default, (char *)str_1},
149
    { osd_fcmode_jopl, (char *)str_3}
145
    { osd_fcmode_jopl, (char *)str_3}
150
};
146
};
-
 
147
int (*osd_fcmode)(void) = (int(*)(void)) & osd_fcmode_default;
-
 
148
#else
151
 
149
 
-
 
150
const displaymode_t ncdisplaymodes[] PROGMEM = {
-
 
151
    { osd_ncmode_default, (char *)str_1},
-
 
152
    { osd_ncmode_minimal, (char *)str_2}
-
 
153
};
152
int (*osd_ncmode)(void) = (int(*)(void)) & osd_ncmode_default;
154
int (*osd_ncmode)(void) = (int(*)(void)) & osd_ncmode_default;
153
int (*osd_fcmode)(void) = (int(*)(void)) & osd_fcmode_default;
-
 
-
 
155
#endif
-
 
156
 
-
 
157
 
154
#endif
158
#endif
155
 
159
 
156
/* ##########################################################################
160
/* ##########################################################################
157
 * Interrupt handler
161
 * Interrupt handler
158
 * ##########################################################################*/
162
 * ##########################################################################*/
Line 332... Line 336...
332
 
336
 
333
 
337
 
334
    // clear serial screen
338
    // clear serial screen
335
    //usart1_puts("\x1B[2J\x1B[H");
339
    //usart1_puts("\x1B[2J\x1B[H");
336
 
340
 
-
 
341
 
337
    while (1) {
342
    while (1) {
338
        // in case SPI is ready and there is nothing to send right now
343
        // in case SPI is ready and there is nothing to send right now
339
        if (!icnt && spi_ready) {
344
        if (!icnt && spi_ready) {
340
            // correct transfer ends with d (done)
345
            // correct transfer ends with d (done)
341
            if (SPI_buffer.buffer.chk == 'd') {
346
            if (SPI_buffer.buffer.chk == 'd') {
Line 358... Line 363...
358
        }
363
        }
359
        if (rxd_buffer_locked) {
364
        if (rxd_buffer_locked) {
360
#if FCONLY
365
#if FCONLY
361
            if (rxd_buffer[2] == 'D') { // FC Data
366
            if (rxd_buffer[2] == 'D') { // FC Data
362
                Decode64();
367
                Decode64();
363
                debugData = *((DebugOut_t*)pRxData);
368
                debugData = *((str_DebugOut*)pRxData);
364
 
369
 
365
                // init on first data retrival, distinguished by last battery :)
370
                // init on first data retrival, distinguished by last battery :)
366
                if (last_UBat == 255) {
371
                if (last_UBat == 255) {
367
                    if (debugData.Analog[9] > 40) {
372
                    if (debugData.Analog[9] > 40) {
368
                        // fix for min_UBat
373
                        // fix for min_UBat
Line 434... Line 439...
434
        // handle keypress
439
        // handle keypress
435
        if (s1_pressed()) {
440
        if (s1_pressed()) {
436
            config_menu();
441
            config_menu();
437
        }
442
        }
438
        if (seconds_since_last_data > 0) {
443
        if (seconds_since_last_data > 0) {
-
 
444
                        #if !FCONLY
-
 
445
                        usart1_request_nc_uart();
-
 
446
                        #endif
-
 
447
 
439
            usart1_EnableTXD();
448
            usart1_EnableTXD();
440
            //usart1_puts_pgm(PSTR("zu alt\r\n"));
449
            //usart1_puts_pgm(PSTR("zu alt\r\n"));
441
#if FCONLY
450
#if FCONLY
442
            // request data ever 100ms from FC;
451
            // request data ever 100ms from FC;
443
            //usart1_request_mk_data(0, 'd', 100);
452
            //usart1_request_mk_data(0, 'd', 100);