Subversion Repositories Projects

Rev

Rev 772 | Rev 787 | Go to most recent revision | Show entire file | Ignore 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))
Line 62... Line 62...
62
 
62
 
63
volatile NaviData_t naviData;
63
volatile NaviData_t naviData;
Line 64... Line 64...
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
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";
Line 141... Line -...
141
 
-
 
142
const displaymode_t ncdisplaymodes[] PROGMEM = {
-
 
143
    { osd_ncmode_default, (char *)str_1},
-
 
144
    { osd_ncmode_minimal, (char *)str_2}
141
 
145
};
-
 
146
 
142
#if FCONLY
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}
-
 
146
};
-
 
147
int (*osd_fcmode)(void) = (int(*)(void)) & osd_fcmode_default;
Line -... Line 148...
-
 
148
#else
-
 
149
 
-
 
150
const displaymode_t ncdisplaymodes[] PROGMEM = {
-
 
151
    { osd_ncmode_default, (char *)str_1},
150
};
152
    { osd_ncmode_minimal, (char *)str_2}
151
 
-
 
-
 
153
};
-
 
154
int (*osd_ncmode)(void) = (int(*)(void)) & osd_ncmode_default;
-
 
155
#endif
152
int (*osd_ncmode)(void) = (int(*)(void)) & osd_ncmode_default;
156
 
Line 153... Line 157...
153
int (*osd_fcmode)(void) = (int(*)(void)) & osd_fcmode_default;
157
 
154
#endif
158
#endif
155
 
159
 
Line 332... Line 336...
332
 
336
 
333
 
337
 
Line -... Line 338...
-
 
338
    // clear serial screen
334
    // clear serial screen
339
    //usart1_puts("\x1B[2J\x1B[H");
335
    //usart1_puts("\x1B[2J\x1B[H");
340
 
336
 
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
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);
Line 364... Line 369...
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) {
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);
444
            usart1_puts_pgm(PSTR(REQUEST_DBG_DATA));
453
            usart1_puts_pgm(PSTR(REQUEST_DBG_DATA));
445
#else
454
#else                   
446
            // request OSD Data from NC every 100ms
455
            // request OSD Data from NC every 100ms
447
            //usart1_request_mk_data(1, 'o', 100);
456
            //usart1_request_mk_data(1, 'o', 100);
448
            usart1_puts_pgm(PSTR(REQUEST_OSD_DATA));
457
            usart1_puts_pgm(PSTR(REQUEST_OSD_DATA));
Line 449... Line 458...
449
 
458