aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/px4io/px4io.cpp
diff options
context:
space:
mode:
authorSimon Wilks <sjwilks@gmail.com>2013-03-06 22:52:19 +0100
committerSimon Wilks <sjwilks@gmail.com>2013-03-06 22:52:19 +0100
commit5c12b6a91113e924f2264e1b0d04d6f865eb3c64 (patch)
tree784f22aab4b4996533e68eef8084a2e021232dc3 /apps/drivers/px4io/px4io.cpp
parentae98836db8948edbcf59333627b25f69df4127d4 (diff)
downloadpx4-firmware-5c12b6a91113e924f2264e1b0d04d6f865eb3c64.tar.gz
px4-firmware-5c12b6a91113e924f2264e1b0d04d6f865eb3c64.tar.bz2
px4-firmware-5c12b6a91113e924f2264e1b0d04d6f865eb3c64.zip
Request result of rc config upload from IO
Diffstat (limited to 'apps/drivers/px4io/px4io.cpp')
-rw-r--r--apps/drivers/px4io/px4io.cpp11
1 files changed, 10 insertions, 1 deletions
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 <px4io/protocol.h>
#include "uploader.h"
+#include <debug.h>
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;
}