Skip to content

Commit

Permalink
ubx: add missing out RTC3X protocol flag for I2C interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor-Misic authored and bkueng committed Dec 16, 2022
1 parent d3d9232 commit 5882667
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/gps_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,13 @@ class GPSHelper
};

enum class InterfaceProtocolsMask : int32_t {
ALL_DISABLED = 0,
I2C_IN_PROT_UBX = 1 << 0,
I2C_IN_PROT_NMEA = 1 << 1,
I2C_IN_PROT_RTCM3X = 1 << 2,
I2C_OUT_PROT_UBX = 1 << 3,
I2C_OUT_PROT_NMEA = 1 << 4
ALL_DISABLED = 0,
I2C_IN_PROT_UBX = 1 << 0,
I2C_IN_PROT_NMEA = 1 << 1,
I2C_IN_PROT_RTCM3X = 1 << 2,
I2C_OUT_PROT_UBX = 1 << 3,
I2C_OUT_PROT_NMEA = 1 << 4,
I2C_OUT_PROT_RTCM3X = 1 << 5
};

struct GPSConfig {
Expand Down
3 changes: 2 additions & 1 deletion src/ubx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@ int GPSDriverUBX::configureDevice(const GPSConfig &config, const int32_t uart2_b
config.interface_protocols & InterfaceProtocolsMask::I2C_OUT_PROT_NMEA, cfg_valset_msg_size);

if (_board == Board::u_blox9_F9P) {
cfgValset<uint8_t>(UBX_CFG_KEY_CFG_I2COUTPROT_RTCM3X, 0, cfg_valset_msg_size);
cfgValset<uint8_t>(UBX_CFG_KEY_CFG_I2COUTPROT_RTCM3X,
config.interface_protocols & InterfaceProtocolsMask::I2C_OUT_PROT_RTCM3X, cfg_valset_msg_size);
}

if (!sendMessage(UBX_MSG_CFG_VALSET, (uint8_t *)&_buf, cfg_valset_msg_size)) {
Expand Down

0 comments on commit 5882667

Please sign in to comment.