mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:28:53 +08:00
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
This commit is contained in:
@@ -1273,6 +1273,9 @@ PX4IO::print_status()
|
|||||||
((alarms & PX4IO_P_STATUS_ALARMS_FMU_LOST) ? " FMU_LOST" : ""),
|
((alarms & PX4IO_P_STATUS_ALARMS_FMU_LOST) ? " FMU_LOST" : ""),
|
||||||
((alarms & PX4IO_P_STATUS_ALARMS_RC_LOST) ? " RC_LOST" : ""),
|
((alarms & PX4IO_P_STATUS_ALARMS_RC_LOST) ? " RC_LOST" : ""),
|
||||||
((alarms & PX4IO_P_STATUS_ALARMS_PWM_ERROR) ? " PWM_ERROR" : ""));
|
((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",
|
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_VBATT),
|
||||||
io_reg_get(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_IBATT),
|
io_reg_get(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_IBATT),
|
||||||
|
|||||||
@@ -217,9 +217,8 @@ controls_tick() {
|
|||||||
if (assigned_channels == 0) {
|
if (assigned_channels == 0) {
|
||||||
rc_input_lost = true;
|
rc_input_lost = true;
|
||||||
} else {
|
} 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_flags |= PX4IO_P_STATUS_FLAGS_RC_OK;
|
||||||
r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_RC_LOST;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ mixer_tick(void)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK;
|
r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK;
|
||||||
r_status_alarms &= ~PX4IO_P_STATUS_ALARMS_FMU_LOST;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
source = MIX_FAILSAFE;
|
source = MIX_FAILSAFE;
|
||||||
|
|||||||
@@ -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();
|
system_state.fmu_data_received_time = hrt_absolute_time();
|
||||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_FMU_OK;
|
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;
|
r_status_flags &= ~PX4IO_P_STATUS_FLAGS_RAW_PWM;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user