Skip to content

Commit

Permalink
bbx 3d speed when gps_use_3d_speed==true (betaflight#13831)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Efimov authored Aug 20, 2024
1 parent 295d542 commit 8feb741
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/main/blackbox/blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,13 @@ static void writeGPSFrame(timeUs_t currentTimeUs)
blackboxWriteSignedVB(gpsSol.llh.lat - gpsHistory.GPS_home[GPS_LATITUDE]);
blackboxWriteSignedVB(gpsSol.llh.lon - gpsHistory.GPS_home[GPS_LONGITUDE]);
blackboxWriteSignedVB(gpsSol.llh.altCm / 10); // log altitude in increments of 0.1m
blackboxWriteUnsignedVB(gpsSol.groundSpeed);

if (gpsConfig()->gps_use_3d_speed) {
blackboxWriteUnsignedVB(gpsSol.speed3d);
} else {
blackboxWriteUnsignedVB(gpsSol.groundSpeed);
}

blackboxWriteUnsignedVB(gpsSol.groundCourse);

gpsHistory.GPS_numSat = gpsSol.numSat;
Expand Down
3 changes: 2 additions & 1 deletion src/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ blackbox_unittest_SRC := \
$(USER_DIR)/common/printf.c \
$(USER_DIR)/common/maths.c \
$(USER_DIR)/common/typeconversion.c \
$(USER_DIR)/drivers/accgyro/gyro_sync.c
$(USER_DIR)/drivers/accgyro/gyro_sync.c \
$(USER_DIR)/pg/gps.c

blackbox_encoding_unittest_SRC := \
$(USER_DIR)/blackbox/blackbox_encoding.c \
Expand Down

0 comments on commit 8feb741

Please sign in to comment.