Subversion Repositories Projects

Rev

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

Rev 378 Rev 379
Line 67... Line 67...
67
char stats_item_0[] PROGMEM = "max Altitude:";
67
char stats_item_0[] PROGMEM = "max Altitude:";
68
char stats_item_1[] PROGMEM = "max Speed   :";
68
char stats_item_1[] PROGMEM = "max Speed   :";
69
char stats_item_2[] PROGMEM = "max Distance:";
69
char stats_item_2[] PROGMEM = "max Distance:";
70
char stats_item_3[] PROGMEM = "min voltage :";
70
char stats_item_3[] PROGMEM = "min voltage :";
71
char stats_item_4[] PROGMEM = "max time    :";
71
char stats_item_4[] PROGMEM = "max time    :";
72
char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2, stats_item_3, stats_item_4};
72
char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2,
-
 
73
                                        stats_item_3, stats_item_4};
Line 73... Line 74...
73
 
74
 
74
// store more fixed strings in progmen
75
// store more fixed strings in progmen
75
char ON[]  PROGMEM = "ON ";
76
char ON[] PROGMEM = "ON ";
Line -... Line 77...
-
 
77
char OFF[] PROGMEM = "OFF";
-
 
78
 
-
 
79
// big vario arrays 
-
 
80
char vario_00[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xff};
-
 
81
char vario_01[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xc0};
-
 
82
char vario_02[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0xc1};
-
 
83
char vario_03[5] PROGMEM = {0x00, 0x00, 0xc2, 0xff, 0x00};
-
 
84
char vario_04[5] PROGMEM = {0x00, 0x00, 0xc2, 0xc0, 0x00};
-
 
85
char vario_05[5] PROGMEM = {0x00, 0x00, 0xc2, 0xc1, 0x00};
-
 
86
char vario_06[5] PROGMEM = {0x00, 0x00, 0xc2, 0x00, 0x00};
-
 
87
char vario_07[5] PROGMEM = {0x00, 0x00, 0xbb, 0x00, 0x00};
-
 
88
char vario_08[5] PROGMEM = {0x00, 0x00, 0xc3, 0x00, 0x00};
-
 
89
char vario_09[5] PROGMEM = {0x00, 0xc4, 0xc3, 0x00, 0x00};
-
 
90
char vario_10[5] PROGMEM = {0x00, 0xc5, 0xc3, 0x00, 0x00};
-
 
91
char vario_11[5] PROGMEM = {0x00, 0xff, 0xc3, 0x00, 0x00};
-
 
92
char vario_12[5] PROGMEM = {0xc4, 0xff, 0xc3, 0x00, 0x00};
-
 
93
char vario_13[5] PROGMEM = {0xc5, 0xff, 0xc3, 0x00, 0x00};
-
 
94
char vario_14[5] PROGMEM = {0xff, 0xff, 0xc3, 0x00, 0x00};
-
 
95
char* vario_pnt[15] PROGMEM = {vario_00, vario_01, vario_02, vario_03, vario_04,
-
 
96
                                vario_05, vario_06, vario_07, vario_08,
-
 
97
                                vario_09, vario_10, vario_11, vario_12,
76
char OFF[] PROGMEM = "OFF";
98
                                vario_13, vario_14};
Line 77... Line 99...
77
 
99
 
78
#endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1))
100
#endif // ends !(ALLCHARSDEBUG|(WRITECHARS != -1))
79
 
101
 
Line 201... Line 223...
201
        if (voltage < UBAT_WRN) percent = 0;
223
        if (voltage < UBAT_WRN) percent = 0;
202
        write_char_xy(x, y, 0x9d - (percent * 13 / 100));
224
        write_char_xy(x, y, 0x9d - (percent * 13 / 100));
203
        //write_ndigit_number_u(x, y-1, percent * 13 / 100, 100, 0);
225
        //write_ndigit_number_u(x, y-1, percent * 13 / 100, 100, 0);
204
}
226
}
Line -... Line 227...
-
 
227
 
-
 
228
/* ##########################################################################
-
 
229
 * variometer
205
 
230
 * ##########################################################################*/
206
/**
231
/**
207
 * draw variometer arrows at <x>/<y> according to <variometer>
232
 * draw variometer arrows at <x>/<y> according to <variometer>
208
 */
233
 */
209
void draw_variometer(uint8_t x, uint8_t y, int16_t variometer) {
234
void draw_variometer(uint8_t x, uint8_t y, int16_t variometer) {
Line 238... Line 263...
238
                                write_char_xy(x, y, 0xbf); // largest arrow down
263
                                write_char_xy(x, y, 0xbf); // largest arrow down
239
                }
264
                }
240
        }
265
        }
241
}
266
}
Line -... Line 267...
-
 
267
 
-
 
268
/**
-
 
269
 * draw a bigger vario with middle at <x>/<y> acording to <variometer>
-
 
270
 */
-
 
271
void draw_big_variometer(uint8_t x, uint8_t y, int16_t variometer) {   
-
 
272
        int16_t index = 7 + variometer;
-
 
273
        if (index > 14) index = 14;
-
 
274
        else if (index < 0) index = 0;
-
 
275
       
-
 
276
        // TODO: why does write_string_pgm_down(x, y-2, vario_pnt[index], 5);
-
 
277
        // not work??? WTF?!
-
 
278
        switch (index) {
-
 
279
                case 0: write_string_pgm_down(x, y-2, vario_pnt[0], 5);
-
 
280
                        break;
-
 
281
                case 1: write_string_pgm_down(x, y-2, vario_pnt[1], 5);
-
 
282
                        break;
-
 
283
                case 2: write_string_pgm_down(x, y-2, vario_pnt[2], 5);
-
 
284
                        break;
-
 
285
                case 3: write_string_pgm_down(x, y-2, vario_pnt[3], 5);
-
 
286
                        break;
-
 
287
                case 4: write_string_pgm_down(x, y-2, vario_pnt[4], 5);
-
 
288
                        break;
-
 
289
                case 5: write_string_pgm_down(x, y-2, vario_pnt[5], 5);
-
 
290
                        break;
-
 
291
                case 6: write_string_pgm_down(x, y-2, vario_pnt[6], 5);
-
 
292
                        break;
-
 
293
                case 7: write_string_pgm_down(x, y-2, vario_pnt[7], 5);
-
 
294
                        break;
-
 
295
                case 8: write_string_pgm_down(x, y-2, vario_pnt[8], 5);
-
 
296
                        break;
-
 
297
                case 9: write_string_pgm_down(x, y-2, vario_pnt[9], 5);
-
 
298
                        break;
-
 
299
                case 10: write_string_pgm_down(x, y-2, vario_pnt[10], 5);
-
 
300
                        break;
-
 
301
                case 11: write_string_pgm_down(x, y-2, vario_pnt[11], 5);
-
 
302
                        break;
-
 
303
                case 12: write_string_pgm_down(x, y-2, vario_pnt[12], 5);
-
 
304
                        break;
-
 
305
                case 13: write_string_pgm_down(x, y-2, vario_pnt[13], 5);
-
 
306
                        break;
-
 
307
                default: write_string_pgm_down(x, y-2, vario_pnt[14], 5);
-
 
308
        }              
-
 
309
}
242
 
310
 
243
/* ##########################################################################
311
/* ##########################################################################
244
 * artificial horizon
312
 * artificial horizon
245
 * ##########################################################################*/
313
 * ##########################################################################*/
246
// remember last time displayed values
314
// remember last time displayed values
Line 636... Line 704...
636
                                        write_number_s(12, 8, debugData.Analog[11]);// Gyro compass*/
704
                                        write_number_s(12, 8, debugData.Analog[11]);// Gyro compass*/
637
                } else if (rxd_buffer[2] == 'O') { // NC OSD Data
705
                } else if (rxd_buffer[2] == 'O') { // NC OSD Data
638
                    Decode64();
706
                    Decode64();
639
                    naviData = *((NaviData_t*) pRxData);
707
                    naviData = *((NaviData_t*) pRxData);
Line -... Line 708...
-
 
708
 
-
 
709
                                        draw_big_variometer(27, 8, naviData.Variometer);
640
 
710
 
641
                    // first line
711
                    // first line
Line 642... Line 712...
642
                    write_ndigit_number_u(2, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t)9) / (uint32_t)250), 100, 0);
712
                    write_ndigit_number_u(2, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t)9) / (uint32_t)250), 100, 0);
643
 
713