Skip to content

Commit

Permalink
GDL90: report WGS-84 ellipsoid altitude again as the 'Ownership Geome…
Browse files Browse the repository at this point in the history
…tric Altitude' [skip ci]
  • Loading branch information
lyusupov committed Oct 14, 2021
1 parent c2bbee9 commit 5b89e28
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/CC13XX.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ extern SCSerial scSerial;
//#define EXCLUDE_OLED_BARO_PAGE
//#define EXCLUDE_LK8EX1
#define USE_GNSS_PSM
//#define USE_GDL90_MSL

//#define USE_BASICMAC
#define USE_TIME_SLOTS
Expand Down
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ struct rst_info {

/* Experimental */
//#define USE_BLE_MIDI
//#define USE_GDL90_MSL

//#define EXCLUDE_GNSS_UBLOX /* Neo-6/7/8 */
#define ENABLE_UBLOX_RFS /* revert factory settings (when necessary) */
Expand Down
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/STM32.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ typedef struct stm32_backup_struct {
#define EXCLUDE_LED_RING // - kb
#define EXCLUDE_SOUND
//#define USE_GNSS_PSM
//#define USE_GDL90_MSL
#define EXCLUDE_LK8EX1
#define EXCLUDE_IMU

Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static void nRF52_setup()
ui = &ui_settings;

#if 0
uint32_t reset_reason = getResetReason();
uint32_t reset_reason = readResetReason();

if (reset_reason & POWER_RESETREAS_RESETPIN_Msk)
{
Expand Down
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/nRF52.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ struct rst_info {
//#define USE_USB_MIDI
//#define USE_BLE_MIDI
//#define USE_PWM_SOUND
//#define USE_GDL90_MSL
//#define EXCLUDE_NUS
#define EXCLUDE_BOARD_SELF_DETECT

Expand Down
10 changes: 7 additions & 3 deletions software/firmware/source/SoftRF/src/protocol/data/GDL90.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ const GDL90_Msg_FF_ID_t msgFFid = {
.ShortName = {'S', 'o', 'f', 't', 'R', 'F', ' ', ' ' },
.LongName = {'S', 'o', 'f', 't', 'R', 'F',
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
#if !defined(USE_GDL90_MSL)
.Capabilities = {0x00, 0x00, 0x00, 0x00}, /* WGS-84 ellipsoid altitude for Ownship Geometric report */
#else
.Capabilities = {0x00, 0x00, 0x00, 0x01}, /* MSL altitude for Ownship Geometric report */
#endif /* USE_GDL90_MSL */
};
#endif
#endif /* DO_GDL90_FF_EXT */

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

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

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

0 comments on commit 5b89e28

Please sign in to comment.