Rev 954 | Rev 1437 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 954 | Rev 1197 | ||
---|---|---|---|
Line 58... | Line 58... | ||
58 | /* ########################################################################## |
58 | /* ########################################################################## |
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 | #if FCONLY |
- | 64 | volatile str_DebugOut debugData; |
|
- | 65 | #else |
|
- | 66 | volatile NaviData_t naviData; |
|
Line 64... | Line 67... | ||
64 | volatile str_DebugOut debugData; |
67 | #endif |
65 | 68 | ||
66 | // cache old vars for blinking attribute, checkup is faster than full |
69 | // cache old vars for blinking attribute, checkup is faster than full |
67 | // attribute write each time |
70 | // attribute write each time |
Line 104... | Line 107... | ||
104 | uint16_t max_FlyingTime = 0; |
107 | uint16_t max_FlyingTime = 0; |
Line 105... | Line 108... | ||
105 | 108 | ||
106 | // flags from last round to check for changes |
109 | // flags from last round to check for changes |
Line 107... | Line -... | ||
107 | uint8_t old_MKFlags = 0; |
- | |
108 | - | ||
109 | // store stats description in progmem to save space |
- | |
110 | const char stats_item_0[] PROGMEM = "max Altitude:"; |
- | |
111 | const char stats_item_1[] PROGMEM = "max Speed :"; |
- | |
112 | const char stats_item_2[] PROGMEM = "max Distance:"; |
- | |
113 | const char stats_item_3[] PROGMEM = "min Voltage :"; |
- | |
114 | const char stats_item_4[] PROGMEM = "max Time:"; |
- | |
115 | const char stats_item_5[] PROGMEM = "longitude :"; |
- | |
116 | const char stats_item_6[] PROGMEM = "latitude:"; |
- | |
117 | const char stats_item_7[] PROGMEM = "max current :"; |
- | |
118 | const char *stats_item_pointers[8] PROGMEM = {stats_item_0, stats_item_1, stats_item_2, |
- | |
119 | stats_item_3, stats_item_4, stats_item_5, stats_item_6, stats_item_7}; |
110 | uint8_t old_MKFlags = 0; |
120 | 111 | ||
121 | //char* directions[8] = {"NE", "E ", "SE", "S ", "SW", "W ", "NW", "N "}; |
- | |
122 | //char arrowdir[8] = {218, 217, 224, 223, 222, 221, 220, 219}; |
- | |
123 | const char str_NE[] PROGMEM = "NE"; |
- | |
124 | const char str_E[] PROGMEM = "E "; |
- | |
125 | const char str_SE[] PROGMEM = "SE"; |
- | |
126 | const char str_S[] PROGMEM = "S "; |
- | |
127 | const char str_SW[] PROGMEM = "SW"; |
- | |
128 | const char str_W[] PROGMEM = "W "; |
- | |
129 | const char str_NW[] PROGMEM = "NW"; |
- | |
130 | const char str_N[] PROGMEM = "N "; |
- | |
131 | const char *directions[8] PROGMEM = { |
- | |
132 | str_NE, |
- | |
133 | str_E, |
- | |
134 | str_SE, |
- | |
135 | str_S, |
- | |
136 | str_SW, |
- | |
137 | str_W, |
- | |
138 | str_NW, |
112 | char* directions[8] = {"NE", "E ", "SE", "S ", "SW", "W ", "NW", "N "}; |
Line 139... | Line 113... | ||
139 | str_N |
113 | //char arrowdir[8] = {218, 217, 224, 223, 222, 221, 220, 219}; |
140 | }; |
114 | |
141 | 115 | ||
142 | /* ########################################################################## |
116 | /* ########################################################################## |
Line 401... | Line 375... | ||
401 | #else |
375 | #else |
402 | if (rxd_buffer[2] == 'O') { // NC OSD Data |
376 | if (rxd_buffer[2] == 'O') { // NC OSD Data |
403 | Decode64(); |
377 | Decode64(); |
404 | naviData = *((NaviData_t*)pRxData); |
378 | naviData = *((NaviData_t*)pRxData); |
Line -... | Line 379... | ||
- | 379 | ||
- | 380 | #ifdef SHIFTBYminus45 |
|
- | 381 | naviData.AngleNick = (int8_t)(((int16_t)naviData.AngleRoll + (int16_t)naviData.AngleNick) / 2); |
|
- | 382 | naviData.AngleRoll = (int8_t)(((int16_t)naviData.AngleRoll - (int16_t)naviData.AngleNick) / 2); |
|
- | 383 | naviData.CompassHeading = (naviData.CompassHeading + (360 - 45)) % 360; |
|
- | 384 | #endif |
|
405 | 385 | ||
406 | // init on first data retrival, distinguished by last battery :) |
386 | // init on first data retrival, distinguished by last battery :) |
407 | if (last_UBat == 255) { |
387 | if (last_UBat == 255) { |
408 | if (naviData.UBat > 40) { |
388 | if (naviData.UBat > 40) { |
409 | // fix for min_UBat |
389 | // fix for min_UBat |