diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-04-22 11:30:05 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-04-22 11:30:05 -0700 |
commit | d62058eccf7d3801a752aac11fb2c37f198a239c (patch) | |
tree | bddd90630b677e7af33579885b3698170defe8b4 | |
parent | fe3a568384a35df986594b59b28709674bc83f15 (diff) | |
parent | 873b0f40b5934194f83f360f7193f48762da177d (diff) | |
download | px4-firmware-d62058eccf7d3801a752aac11fb2c37f198a239c.tar.gz px4-firmware-d62058eccf7d3801a752aac11fb2c37f198a239c.tar.bz2 px4-firmware-d62058eccf7d3801a752aac11fb2c37f198a239c.zip |
Merge pull request #251 from yvestroxler/master
Small change in gps-driver (ubx.cpp)
-rw-r--r-- | apps/drivers/gps/ubx.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/drivers/gps/ubx.cpp b/apps/drivers/gps/ubx.cpp index 74cbc5aaf..0d4894b8d 100644 --- a/apps/drivers/gps/ubx.cpp +++ b/apps/drivers/gps/ubx.cpp @@ -113,13 +113,15 @@ UBX::configure(unsigned &baudrate) cfg_prt_packet.outProtoMask = UBX_CFG_PRT_PAYLOAD_OUTPROTOMASK; send_config_packet(_fd, (uint8_t*)&cfg_prt_packet, sizeof(cfg_prt_packet)); + + /* no ACK is expected here, but read the buffer anyway in case we actually get an ACK */ + receive(UBX_CONFIG_TIMEOUT); + if (UBX_CFG_PRT_PAYLOAD_BAUDRATE != baudrate) { set_baudrate(_fd, UBX_CFG_PRT_PAYLOAD_BAUDRATE); baudrate = UBX_CFG_PRT_PAYLOAD_BAUDRATE; } - /* no ack is ecpected here, keep going configuring */ - /* send a CFT-RATE message to define update rate */ type_gps_bin_cfg_rate_packet_t cfg_rate_packet; memset(&cfg_rate_packet, 0, sizeof(cfg_rate_packet)); |