// JRChange: DJI NazaTalk:
#define PROTOCOL_NAZATALK
// JRChange: GPS protocol DJI:
// ground tested but not in flight because of weather conditions !!!
// heading needs some work !!!
#define GPS_PROTOCOL_DJI
// JRChange: DJI NazaTalk:
#define PROTOCOL_NAZATALK
// JRChange: GPS protocol DJI:
// ground tested but not in flight because of weather conditions !!!
// heading needs some work !!!
#define GPS_PROTOCOL_DJI
//#define LED_FIND_VALUES
...
#define NAZA_THRESHOLD_YELLOW 110
#define NAZA_THRESHOLD_RED 70
#define NAZA_THRESHOLD_GREEN 30
// criteria for a stable home position:
// - GPS fix
// - with at least 5 satellites
// - osd_alt stable for 50 * 100ms = 5s
// - osd_alt stable means the delta is lower 0.5m
if (osd_fix_type > 1 && osd_satellites_visible >= 5 && osd_alt_cnt < 50) {
if (fabs(osd_alt_prev - osd_alt) > 0.5) {
osd_alt_cnt = 0;
osd_alt_prev = osd_alt;
} else {
if (++osd_alt_cnt >= 50) {
osd_home_lat = osd_lat; // take this osd_lat as osd_home_lat
osd_home_lon = osd_lon; // take this osd_lon as osd_home_lon
osd_home_alt = osd_alt; // take this stable osd_alt as osd_home_alt
osd_got_home = 1;
}
}
}