Subversion Repositories Projects

Rev

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"
25
 
25
 
26
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
26
#if (!(ALLCHARSDEBUG || (WRITECHARS != -1)) && !FCONLY)
27
 
27
 
28
int osd_ncmode_default() {
28
int osd_ncmode_default() {
29
    uint8_t rc_signal = naviData.RC_RSSI ? naviData.RC_RSSI : naviData.RC_Quality; // if RSSI is present use it, else use Qality
29
    uint8_t rc_signal = naviData.RC_RSSI ? naviData.RC_RSSI : naviData.RC_Quality; // if RSSI is present use it, else use Qality
30
 
30
 
31
    if (COSD_FLAGS_MODES & COSD_FLAG_HUD) {
31
    if (COSD_FLAGS_MODES & COSD_FLAG_HUD) {
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
        }
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
148
                if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
148
                if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
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);
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 {
293
            if (naviData.Altimeter / 20 > max_Altimeter) max_Altimeter = naviData.Altimeter / 20;
293
            if (naviData.Altimeter / 20 > max_Altimeter) max_Altimeter = naviData.Altimeter / 20;
294
        }
294
        }