diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-03-21 18:14:08 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-03-21 18:14:08 +0100 |
commit | 3270e2f42887265f6576b132aa29b4c1037d0b0d (patch) | |
tree | b77acd7cdb0a7fa0bbd1368063fa571e90a1a000 /src/drivers/px4io | |
parent | 4b8c3362cd74b48c59a2a561d821b96df1e727f0 (diff) | |
parent | 69bc0c8e3998f87358bbf8a5f97f5c31dca43f76 (diff) | |
download | px4-firmware-3270e2f42887265f6576b132aa29b4c1037d0b0d.tar.gz px4-firmware-3270e2f42887265f6576b132aa29b4c1037d0b0d.tar.bz2 px4-firmware-3270e2f42887265f6576b132aa29b4c1037d0b0d.zip |
Merge pull request #763 from PX4/beta_mavlink2
Mavlink multi-stream support
Diffstat (limited to 'src/drivers/px4io')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 8e990aa6f..82f3ba044 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1332,12 +1332,15 @@ PX4IO::io_handle_battery(uint16_t vbatt, uint16_t ibatt) battery_status.discharged_mah = _battery_mamphour_total; _battery_last_timestamp = battery_status.timestamp; - /* lazily publish the battery voltage */ - if (_to_battery > 0) { - orb_publish(ORB_ID(battery_status), _to_battery, &battery_status); + /* the announced battery status would conflict with the simulated battery status in HIL */ + if (!(_pub_blocked)) { + /* lazily publish the battery voltage */ + if (_to_battery > 0) { + orb_publish(ORB_ID(battery_status), _to_battery, &battery_status); - } else { - _to_battery = orb_advertise(ORB_ID(battery_status), &battery_status); + } else { + _to_battery = orb_advertise(ORB_ID(battery_status), &battery_status); + } } } @@ -1959,8 +1962,7 @@ PX4IO::print_status() } int -PX4IO::ioctl(file * /*filep*/, int cmd, unsigned long arg) -/* Make it obvious that file * isn't used here */ +PX4IO::ioctl(file * filep, int cmd, unsigned long arg) { int ret = OK; @@ -2372,8 +2374,9 @@ PX4IO::ioctl(file * /*filep*/, int cmd, unsigned long arg) break; default: - /* not a recognized value */ - ret = -ENOTTY; + /* see if the parent class can make any use of it */ + ret = CDev::ioctl(filep, cmd, arg); + break; } return ret; |