diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-05-16 09:12:13 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-05-21 09:14:22 +0200 |
commit | 0165034e496d0652f9dbb7d122d808cd6b483e60 (patch) | |
tree | a51ba225eee249ffbed4bdba8cc02587314c3512 /src | |
parent | bc3eca5df3a980cfcc0cc6f03926e1c9f9c24a39 (diff) | |
download | px4-firmware-0165034e496d0652f9dbb7d122d808cd6b483e60.tar.gz px4-firmware-0165034e496d0652f9dbb7d122d808cd6b483e60.tar.bz2 px4-firmware-0165034e496d0652f9dbb7d122d808cd6b483e60.zip |
Hotfix: Changed alarms back to what they originally were designed for: Traps to later see if condition was once violated. Currente status can be read through the status flags
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 3 | ||||
-rw-r--r-- | src/modules/px4iofirmware/controls.c | 3 | ||||
-rw-r--r-- | src/modules/px4iofirmware/mixer.cpp | 1 | ||||
-rw-r--r-- | src/modules/px4iofirmware/registers.c | 1 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index a40142792..8b2fae12b 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1273,6 +1273,9 @@ PX4IO::print_status() ((alarms & PX4IO_P_STATUS_ALARMS_FMU_LOST) ? " FMU_LOST" : ""), ((alarms & PX4IO_P_STATUS_ALARMS_RC_LOST) ? " RC_LOST" : ""), ((alarms & PX4IO_P_STATUS_ALARMS_PWM_ERROR) ? " PWM_ERROR" : "")); + /* now clear alarms */ + io_reg_set(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_ALARMS, 0xFFFF); + printf("vbatt %u ibatt %u vbatt scale %u\n", io_reg_get(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_VBATT), io_reg_get(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_IBATT), diff --git a/src/modules/px4iofirmware/controls.c b/src/modules/px4iofirmware/controls.c index dc36f6c93..3cf9ca149 100644 --- a/src/modules/px4iofirmware/controls.c +++ b/src/modules/px4iofirmware/controls.c @@ -217,9 +217,8 @@ controls_tick() { if (assigned_channels == 0) { rc_input_lost = true; } else { - /* set RC OK flag and clear RC lost alarm */ + /* set RC OK flag */ r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_OK; - r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_RC_LOST; } /* diff --git a/src/modules/px4iofirmware/mixer.cpp b/src/modules/px4iofirmware/mixer.cpp index 5ada1b220..1234e2eea 100644 --- a/src/modules/px4iofirmware/mixer.cpp +++ b/src/modules/px4iofirmware/mixer.cpp @@ -100,7 +100,6 @@ mixer_tick(void) } else { r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK; - r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_FMU_LOST; } source = MIX_FAILSAFE; diff --git a/src/modules/px4iofirmware/registers.c b/src/modules/px4iofirmware/registers.c index 61049c8b6..f21ac6e4c 100644 --- a/src/modules/px4iofirmware/registers.c +++ b/src/modules/px4iofirmware/registers.c @@ -203,7 +203,6 @@ registers_set(uint8_t page, uint8_t offset, const uint16_t *values, unsigned num system_state.fmu_data_received_time = hrt_absolute_time(); r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK; - r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_FMU_LOST; r_status_flags &= ~PX4IO_P_STATUS_FLAGS_RAW_PWM; break; |