diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-24 17:28:04 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-24 17:28:04 +0100 |
commit | 2f968357a368ee59f53d75119b893487abd3883b (patch) | |
tree | 2f3c5bba99484eab85285e5eb303f5857d3fd341 /src | |
parent | 4f78c3e60596d1b596e5ebcf4bb4e101a5b356e7 (diff) | |
download | px4-firmware-2f968357a368ee59f53d75119b893487abd3883b.tar.gz px4-firmware-2f968357a368ee59f53d75119b893487abd3883b.tar.bz2 px4-firmware-2f968357a368ee59f53d75119b893487abd3883b.zip |
Make the protocol version more descriptive - helps to understand when / how px4io detect fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 519aa96eb..6f1323fce 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -580,6 +580,12 @@ PX4IO::init() /* get some parameters */ unsigned protocol = io_reg_get(PX4IO_PAGE_CONFIG, PX4IO_P_CONFIG_PROTOCOL_VERSION); + if (protocol == _io_reg_get_error) { + log("failed to communicate with IO"); + mavlink_log_emergency(_mavlink_fd, "[IO] failed to communicate with IO, abort."); + return -1; + } + if (protocol != PX4IO_PROTOCOL_VERSION) { log("protocol/firmware mismatch"); mavlink_log_emergency(_mavlink_fd, "[IO] protocol/firmware mismatch, abort."); |