Skip to content

Commit 5b89e28

Browse files
committed
GDL90: report WGS-84 ellipsoid altitude again as the 'Ownership Geometric Altitude' [skip ci]
1 parent c2bbee9 commit 5b89e28

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

software/firmware/source/SoftRF/src/platform/CC13XX.h

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ extern SCSerial scSerial;
189189
//#define EXCLUDE_OLED_BARO_PAGE
190190
//#define EXCLUDE_LK8EX1
191191
#define USE_GNSS_PSM
192+
//#define USE_GDL90_MSL
192193

193194
//#define USE_BASICMAC
194195
#define USE_TIME_SLOTS

software/firmware/source/SoftRF/src/platform/ESP32.h

+1
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ struct rst_info {
239239

240240
/* Experimental */
241241
//#define USE_BLE_MIDI
242+
//#define USE_GDL90_MSL
242243

243244
//#define EXCLUDE_GNSS_UBLOX /* Neo-6/7/8 */
244245
#define ENABLE_UBLOX_RFS /* revert factory settings (when necessary) */

software/firmware/source/SoftRF/src/platform/STM32.h

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ typedef struct stm32_backup_struct {
223223
#define EXCLUDE_LED_RING // - kb
224224
#define EXCLUDE_SOUND
225225
//#define USE_GNSS_PSM
226+
//#define USE_GDL90_MSL
226227
#define EXCLUDE_LK8EX1
227228
#define EXCLUDE_IMU
228229

software/firmware/source/SoftRF/src/platform/nRF52.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static void nRF52_setup()
271271
ui = &ui_settings;
272272

273273
#if 0
274-
uint32_t reset_reason = getResetReason();
274+
uint32_t reset_reason = readResetReason();
275275

276276
if (reset_reason & POWER_RESETREAS_RESETPIN_Msk)
277277
{

software/firmware/source/SoftRF/src/platform/nRF52.h

+1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ struct rst_info {
257257
//#define USE_USB_MIDI
258258
//#define USE_BLE_MIDI
259259
//#define USE_PWM_SOUND
260+
//#define USE_GDL90_MSL
260261
//#define EXCLUDE_NUS
261262
#define EXCLUDE_BOARD_SELF_DETECT
262263

software/firmware/source/SoftRF/src/protocol/data/GDL90.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,13 @@ const GDL90_Msg_FF_ID_t msgFFid = {
101101
.ShortName = {'S', 'o', 'f', 't', 'R', 'F', ' ', ' ' },
102102
.LongName = {'S', 'o', 'f', 't', 'R', 'F',
103103
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
104+
#if !defined(USE_GDL90_MSL)
105+
.Capabilities = {0x00, 0x00, 0x00, 0x00}, /* WGS-84 ellipsoid altitude for Ownship Geometric report */
106+
#else
104107
.Capabilities = {0x00, 0x00, 0x00, 0x01}, /* MSL altitude for Ownship Geometric report */
108+
#endif /* USE_GDL90_MSL */
105109
};
106-
#endif
110+
#endif /* DO_GDL90_FF_EXT */
107111

108112
/* convert a signed latitude to 2s complement ready for 24-bit packing */
109113
static uint32_t makeLatitude(float latitude)
@@ -313,7 +317,7 @@ static void *msgOwnershipGeometricAltitude(ufo_t *aircraft)
313317
{
314318
uint16_t vfom = 0x000A;
315319

316-
#if 0
320+
#if !defined(USE_GDL90_MSL)
317321
/*
318322
* The Geo Altitude field is a 16-bit signed integer that represents
319323
* the geometric altitude (height above WGS-84 ellipsoid),
@@ -328,7 +332,7 @@ static void *msgOwnershipGeometricAltitude(ufo_t *aircraft)
328332
* SkyDemon is the only known exception which uses WGS-84 altitude still.
329333
*/
330334
uint16_t altitude = (int16_t)(aircraft->altitude * _GPS_FEET_PER_METER / 5);
331-
#endif
335+
#endif /* USE_GDL90_MSL */
332336

333337
GeometricAltitude.geo_altitude = ((altitude & 0x00FF) << 8) | ((altitude & 0xFF00) >> 8) ;
334338
GeometricAltitude.VFOM = ((vfom & 0x00FF) << 8) | ((vfom & 0xFF00) >> 8);

0 commit comments

Comments
 (0)