diff options
author | Andrew Tridgell <tridge@samba.org> | 2013-11-16 18:36:48 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-10 11:59:06 +0100 |
commit | ea33a19c8f5b109fd9ba35603b0af56dddef3708 (patch) | |
tree | 1bae88abccc90491bcdec45752c48f5c4409f836 | |
parent | 4ce4b8a174cae4053f8df59de1455589ab1e16b8 (diff) | |
download | px4-firmware-ea33a19c8f5b109fd9ba35603b0af56dddef3708.tar.gz px4-firmware-ea33a19c8f5b109fd9ba35603b0af56dddef3708.tar.bz2 px4-firmware-ea33a19c8f5b109fd9ba35603b0af56dddef3708.zip |
lsm303d: show regs at both high and low bus speed on error
-rw-r--r-- | src/drivers/lsm303d/lsm303d.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp index 6d7b3df50..2d150cdba 100644 --- a/src/drivers/lsm303d/lsm303d.cpp +++ b/src/drivers/lsm303d/lsm303d.cpp @@ -708,11 +708,20 @@ LSM303D::check_extremes(const accel_report *arb) ADDR_ACT_THS, ADDR_ACT_DUR, ADDR_OUT_X_L_M, ADDR_OUT_X_H_M, ADDR_OUT_Y_L_M, ADDR_OUT_Y_H_M, ADDR_OUT_Z_L_M, ADDR_OUT_Z_H_M}; - ::dprintf(_accel_log_fd, "REG %llu", (unsigned long long)hrt_absolute_time()); + ::dprintf(_accel_log_fd, "FREG %llu", (unsigned long long)hrt_absolute_time()); for (uint8_t i=0; i<sizeof(reglist); i++) { ::dprintf(_accel_log_fd, " %02x:%02x", (unsigned)reglist[i], (unsigned)read_reg(reglist[i])); } ::dprintf(_accel_log_fd, "\n"); + if (is_extreme) { + set_frequency(1000*1000); + ::dprintf(_accel_log_fd, "SREG %llu", (unsigned long long)hrt_absolute_time()); + for (uint8_t i=0; i<sizeof(reglist); i++) { + ::dprintf(_accel_log_fd, " %02x:%02x", (unsigned)reglist[i], (unsigned)read_reg(reglist[i])); + } + ::dprintf(_accel_log_fd, "\n"); + set_frequency(8*1000*1000); + } } // fsync at 0.1Hz |