From 911c8e406c79d779634d9961d60c871ae7db9cef Mon Sep 17 00:00:00 2001 From: s0up Date: Mon, 18 Jun 2018 14:43:35 -0700 Subject: [PATCH 1/4] wait for altitude offset to be applied before updating idleTask data --- src/main/flight/gps_rescue.c | 5 +++++ src/main/flight/position.c | 7 ++++++- src/main/flight/position.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/flight/gps_rescue.c b/src/main/flight/gps_rescue.c index 491c0f1c4..9e80cb0d1 100644 --- a/src/main/flight/gps_rescue.c +++ b/src/main/flight/gps_rescue.c @@ -303,6 +303,11 @@ void idleTasks() return; } + // Don't update any rescue flight statistics if we haven't applied a proper altitude offset yet + if (!isAltitudeOffset()) { + return; + } + gpsRescueAngle[AI_PITCH] = 0; gpsRescueAngle[AI_ROLL] = 0; diff --git a/src/main/flight/position.c b/src/main/flight/position.c index 8d510e7f1..d55803d62 100644 --- a/src/main/flight/position.c +++ b/src/main/flight/position.c @@ -44,12 +44,13 @@ static int32_t estimatedAltitude = 0; // in cm #if defined(USE_BARO) || defined(USE_GPS) +static bool altitudeOffsetSet = false; + void calculateEstimatedAltitude(timeUs_t currentTimeUs) { static timeUs_t previousTimeUs = 0; static int32_t baroAltOffset = 0; static int32_t gpsAltOffset = 0; - static bool altitudeOffsetSet = false; const uint32_t dTime = currentTimeUs - previousTimeUs; if (dTime < BARO_UPDATE_FREQUENCY_40HZ) { @@ -111,6 +112,10 @@ if (sensors(SENSOR_GPS) && STATE(GPS_FIX)) { } #endif +bool isAltitudeOffset(void) +{ + return altitudeOffsetSet; +} int32_t getEstimatedAltitude(void) { diff --git a/src/main/flight/position.h b/src/main/flight/position.h index af7a3b3ec..c7b98173b 100644 --- a/src/main/flight/position.h +++ b/src/main/flight/position.h @@ -22,6 +22,7 @@ #include "common/time.h" +bool isAltitudeOffset(void); void calculateEstimatedAltitude(timeUs_t currentTimeUs); int32_t getEstimatedAltitude(void); int16_t getEstimatedVario(void); \ No newline at end of file From ce1a3edc037af61650bc1afc0c601aa84674a782 Mon Sep 17 00:00:00 2001 From: s0up Date: Tue, 19 Jun 2018 09:06:29 -0700 Subject: [PATCH 2/4] put altitude offset getter within same ifdef as calculate estimated altitude --- src/main/flight/position.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/flight/position.c b/src/main/flight/position.c index d55803d62..771baa0f0 100644 --- a/src/main/flight/position.c +++ b/src/main/flight/position.c @@ -110,12 +110,12 @@ if (sensors(SENSOR_GPS) && STATE(GPS_FIX)) { DEBUG_SET(DEBUG_ALTITUDE, 1, baroAlt); DEBUG_SET(DEBUG_ALTITUDE, 2, gpsAlt); } -#endif bool isAltitudeOffset(void) { return altitudeOffsetSet; } +#endif int32_t getEstimatedAltitude(void) { From 8f65a7978920f9b48c21ca84024f277728eae220 Mon Sep 17 00:00:00 2001 From: jflyper Date: Wed, 20 Jun 2018 07:47:34 +0900 Subject: [PATCH 3/4] Remove RX_PARALLEL_PWM originated feature validation based on pins --- src/main/fc/config.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/fc/config.c b/src/main/fc/config.c index 55ddccd9b..421af8c31 100644 --- a/src/main/fc/config.c +++ b/src/main/fc/config.c @@ -213,16 +213,6 @@ static void validateAndFixConfig(void) if (featureConfigured(FEATURE_RX_PARALLEL_PWM)) { featureClear(FEATURE_RX_SERIAL | FEATURE_RX_MSP | FEATURE_RX_PPM | FEATURE_RX_SPI); -#if defined(STM32F10X) - // rssi adc needs the same ports - featureClear(FEATURE_RSSI_ADC); - // current meter needs the same ports - if (batteryConfig()->currentMeterSource == CURRENT_METER_ADC) { - batteryConfigMutable()->currentMeterSource = CURRENT_METER_NONE; - } -#endif // STM32F10X - // software serial needs free PWM ports - featureClear(FEATURE_SOFTSERIAL); } #ifdef USE_SOFTSPI From b907e584d1834b3c6ce769acdf85155821b109c1 Mon Sep 17 00:00:00 2001 From: Scavanger Date: Wed, 20 Jun 2018 09:12:56 +0200 Subject: [PATCH 4/4] Update Telemetry.md --- docs/Telemetry.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/Telemetry.md b/docs/Telemetry.md index 05ab19908..b9871c58d 100644 --- a/docs/Telemetry.md +++ b/docs/Telemetry.md @@ -107,7 +107,10 @@ Use the latest Graupner firmware for your transmitter and receiver. Older HoTT transmitters required the EAM and GPS modules to be enabled in the telemetry menu of the transmitter. (e.g. on MX-20) -Serial ports use two wires but HoTT uses a single wire so some electronics are required so that the signals don't get mixed up. The TX and RX pins of +You can connect HoTT-Telemetry in two ways: + +#### Old way: +Serial ports use two wires but HoTT uses a single wire so some electronics are required so that the signals don't get mixed up. The TX and RX pins of a serial port should be connected using a diode and a single wire to the `T` port on a HoTT receiver. Connect as follows: @@ -122,6 +125,11 @@ The diode should be arranged to allow the data signals to flow the right way ``` 1N4148 diodes have been tested and work with the GR-24. + +When using the diode disable `tlm_halfduplex`, go to CLI and type `set tlm_halfduplex = OFF`, don't forget a `save` afterwards. + +#### New way: +You can use a single connection, connect HoTT RX/TX only to serial TX, leave serial RX open and make sure `tlm_halfduplex` is ON. As noticed by Skrebber the GR-12 (and probably GR-16/24, too) are based on a PIC 24FJ64GA-002, which has 5V tolerant digital pins.