Make the protocol version more descriptive - helps to understand when / how px4io detect fails.

This commit is contained in:
Lorenz Meier 2014-01-24 17:28:04 +01:00
parent 4f78c3e605
commit 2f968357a3
1 changed files with 6 additions and 0 deletions

View File

@ -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.");