Skip to content

Commit

Permalink
transmit altitude in 10s of meters
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-goddard committed Mar 1, 2024
1 parent a7afc1d commit 98c3a50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ControlTasks/RadioControlTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ bool RadioControlTask::executeDownlink()
{
uint16_t lat = round(map(sfr::gps::latitude, constants::gps::lat_min, constants::gps::lat_max, 0, 65536));
uint16_t lon = round(map(sfr::gps::longitude, constants::gps::lon_min, constants::gps::lon_max, 0, 65536));
uint16_t alt = round(map(sfr::gps::altitude, constants::gps::alt_min, constants::gps::alt_max, 0, 65536));
uint16_t alt = round(map(sfr::gps::altitude / 10, constants::gps::alt_min, constants::gps::alt_max, 0, 65536));

uint8_t flags = ((sfr::radio::mode == radio_mode_type::listen) ? 0xF0 : 0x00) | (sfr::gps::valid_msg ? 0x0F : 0x00);

Expand Down
2 changes: 1 addition & 1 deletion src/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace constants {
constexpr int lon_min = -18000;
constexpr int lon_max = 18000;
constexpr int alt_min = 0;
constexpr int32_t alt_max = 500000;
constexpr int alt_max = 50000; // In 10's of meters
} // namespace gps
namespace opcodes {
constexpr int no_op = 0x00;
Expand Down

0 comments on commit 98c3a50

Please sign in to comment.