From 5c12b6a91113e924f2264e1b0d04d6f865eb3c64 Mon Sep 17 00:00:00 2001 From: Simon Wilks Date: Wed, 6 Mar 2013 22:52:19 +0100 Subject: Request result of rc config upload from IO --- apps/drivers/px4io/px4io.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'apps/drivers/px4io/px4io.cpp') diff --git a/apps/drivers/px4io/px4io.cpp b/apps/drivers/px4io/px4io.cpp index 2611c4e9c..fee49b1aa 100644 --- a/apps/drivers/px4io/px4io.cpp +++ b/apps/drivers/px4io/px4io.cpp @@ -83,6 +83,7 @@ #include #include "uploader.h" +#include class PX4IO : public device::I2C @@ -771,9 +772,17 @@ PX4IO::io_set_rc_config() /* send channel config to IO */ ret = io_reg_set(PX4IO_PAGE_RC_CONFIG, offset, regs, PX4IO_P_RC_CONFIG_STRIDE); if (ret != OK) { - log("RC config update failed"); + log("rc config upload failed"); + break; + } + + /* check the IO initialisation flag */ + ret = io_reg_get(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_FLAGS) & PX4IO_P_STATUS_FLAGS_INIT_OK; + if (ret != OK) { + log("config for RC%d rejected by IO", i + 1); break; } + offset += PX4IO_P_RC_CONFIG_STRIDE; } -- cgit v1.2.3