Rev 772 | Rev 800 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 772 | Rev 783 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | #include "main.h" |
21 | #include "main.h" |
22 | #include "max7456_software_spi.h" |
22 | #include "max7456_software_spi.h" |
23 | #include "osd_helpers.h" |
23 | #include "osd_helpers.h" |
24 | #include "osd_ncmode_default.h" |
24 | #include "osd_ncmode_default.h" |
Line 25... | Line 25... | ||
25 | 25 | ||
Line 26... | Line 26... | ||
26 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
26 | #if (!(ALLCHARSDEBUG || (WRITECHARS != -1)) && !FCONLY) |
27 | 27 | ||
Line 28... | Line 28... | ||
28 | int osd_ncmode_default() { |
28 | int osd_ncmode_default() { |
Line 137... | Line 137... | ||
137 | } else { |
137 | } else { |
138 | write_ndigit_number_u(23, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 4, 0); |
138 | write_ndigit_number_u(23, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 4, 0); |
139 | } |
139 | } |
Line 140... | Line 140... | ||
140 | 140 | ||
141 | // center |
141 | // center |
142 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
142 | if (naviData.FCFlags & FCFLAG_MOTOR_RUN) { // should be engines running |
143 | if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
143 | if (!(old_MKFlags & FCFLAG_MOTOR_RUN)) { // motors just started, clear middle |
144 | clear(); |
144 | clear(); |
145 | // remember current heigth for gps offset |
145 | // remember current heigth for gps offset |
146 | altimeter_offset = naviData.CurrentPosition.Altitude / 1000; |
146 | altimeter_offset = naviData.CurrentPosition.Altitude / 1000; |
147 | // set wasted counter to current offset |
147 | // set wasted counter to current offset |
Line 165... | Line 165... | ||
165 | } |
165 | } |
166 | } |
166 | } |
167 | // motors are on, assume we were/are flying |
167 | // motors are on, assume we were/are flying |
168 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
168 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
169 | } else { |
169 | } else { |
170 | if ((old_MKFlags & FLAG_MOTOR_RUN)) { // motors just stopped |
170 | if ((old_MKFlags & FCFLAG_MOTOR_RUN)) { // motors just stopped |
171 | clear(); // clear whole screen in case there is horizon stuff left |
171 | clear(); // clear whole screen in case there is horizon stuff left |
172 | // update flags to paint display again if needed |
172 | // update flags to paint display again if needed |
173 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
173 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
174 | } |
174 | } |
175 | // stats |
175 | // stats |
Line 284... | Line 284... | ||
284 | 284 | ||
285 | //write_number_s(8, 5, RxDataLen); |
285 | //write_number_s(8, 5, RxDataLen); |
Line 286... | Line 286... | ||
286 | //write_number_s(16, 5, setsReceived++); |
286 | //write_number_s(16, 5, setsReceived++); |
287 | 287 | ||
288 | // remember statistics (only when engines running) |
288 | // remember statistics (only when engines running) |
289 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { |
289 | if (naviData.FCFlags & FCFLAG_MOTOR_RUN) { |
290 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
290 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
291 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
291 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
292 | } else { |
292 | } else { |