Subversion Repositories Projects

Rev

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

Rev 677 Rev 685
Line 38... Line 38...
38
#include "buttons.h"
38
#include "buttons.h"
39
#include "ppm.h"
39
#include "ppm.h"
40
#include "osd_ncmode_default.h"
40
#include "osd_ncmode_default.h"
41
#include "osd_ncmode_minimal.h"
41
#include "osd_ncmode_minimal.h"
42
#include "osd_fcmode_default.h"
42
#include "osd_fcmode_default.h"
-
 
43
#include "osd_fcmode_jopl.h"
43
 
44
 
44
#if WRITECHARS != -1
45
#if WRITECHARS != -1
45
#include "characters.h"
46
#include "characters.h"
46
#endif
47
#endif
47
 
48
 
Line 66... Line 67...
66
volatile uint8_t last_RC_Quality = 255;
67
volatile uint8_t last_RC_Quality = 255;
67
 
68
 
68
// 16bit should be enough, normal LiPos don't last that long
69
// 16bit should be enough, normal LiPos don't last that long
69
volatile uint16_t uptime = 0;
70
volatile uint16_t uptime = 0;
70
volatile uint16_t timer = 0;
71
volatile uint16_t timer = 0;
-
 
72
volatile uint16_t flytime_fc = 0;
71
 
73
 
72
// remember last time data was received
74
// remember last time data was received
73
volatile uint8_t seconds_since_last_data = 0;
75
volatile uint8_t seconds_since_last_data = 0;
74
 
76
 
75
// general PAL|NTSC distingiusch stuff
77
// general PAL|NTSC distingiusch stuff
Line 130... Line 132...
130
/* ##########################################################################
132
/* ##########################################################################
131
 * Different display mode function pointers
133
 * Different display mode function pointers
132
 * ##########################################################################*/
134
 * ##########################################################################*/
133
const char str_1[] PROGMEM  = "default";
135
const char str_1[] PROGMEM  = "default";
134
const char str_2[] PROGMEM  = "minimal";
136
const char str_2[] PROGMEM  = "minimal";
-
 
137
const char str_3[] PROGMEM  = "   jopl";
135
 
138
 
136
const displaymode_t ncdisplaymodes[] PROGMEM = {
139
const displaymode_t ncdisplaymodes[] PROGMEM = {
137
   { osd_ncmode_default, (char *)str_1 },
140
   { osd_ncmode_default, (char *)str_1 },
138
   { osd_ncmode_minimal, (char *)str_2 }
141
   { osd_ncmode_minimal, (char *)str_2 }
139
};
142
};
140
 
143
 
141
const displaymode_t fcdisplaymodes[] PROGMEM = {
144
const displaymode_t fcdisplaymodes[] PROGMEM = {
142
   { osd_fcmode_default, (char *)str_1 },
145
   { osd_fcmode_default, (char *)str_1 },
-
 
146
   { osd_fcmode_jopl, (char *)str_3 }
143
};
147
};
144
 
148
 
145
int (*osd_ncmode)(void) = (int(*)(void)) &osd_ncmode_default;
149
int (*osd_ncmode)(void) = (int(*)(void)) &osd_ncmode_default;
146
int (*osd_fcmode)(void) = (int(*)(void)) &osd_fcmode_default;
150
int (*osd_fcmode)(void) = (int(*)(void)) &osd_fcmode_default;
147
#endif
151
#endif
Line 169... Line 173...
169
 * timer kicks in every 1000uS ^= 1ms
173
 * timer kicks in every 1000uS ^= 1ms
170
 */
174
 */
171
ISR(TIMER0_COMP_vect) {
175
ISR(TIMER0_COMP_vect) {
172
    if (!timer--) {
176
    if (!timer--) {
173
        uptime++;
177
        uptime++;
-
 
178
 
-
 
179
                #if FCONLY
-
 
180
                if (debugData.Analog[12]>10) {
-
 
181
                        flytime_fc++;
-
 
182
                }
-
 
183
                #endif
-
 
184
 
174
        timer = 999;
185
        timer = 999;
175
        seconds_since_last_data++;
186
        seconds_since_last_data++;
176
    }
187
    }
177
    // in case there is still some spi data to send do it now
188
    // in case there is still some spi data to send do it now
178
        // delay to give the slave some time to compute values
189
        // delay to give the slave some time to compute values
Line 317... Line 328...
317
    // we are ready
328
    // we are ready
318
    LED3_ON
329
    LED3_ON
319
 
330
 
320
#if ALLCHARSDEBUG | (WRITECHARS != -1)
331
#if ALLCHARSDEBUG | (WRITECHARS != -1)
321
        clear();
332
        clear();
322
        write_all_chars();
333
        write_all_chars();
323
        LED1_ON
334
        LED1_ON
324
        LED2_ON
335
        LED2_ON
325
        LED3_ON
336
        LED3_ON
326
        LED4_ON
337
        LED4_ON
327
#else
338
#else
328
 
339
 
329
        // clear serial screen
340
        // clear serial screen
330
        //usart1_puts("\x1B[2J\x1B[H");
341
        //usart1_puts("\x1B[2J\x1B[H");