enable disarmed PWM and rework safety switch disable logic

This commit is contained in:
Mark Whitehorn
2016-02-29 12:28:39 -07:00
parent 29b0520263
commit fcfe64ee5a

View File

@@ -1065,18 +1065,21 @@ PX4FMU::cycle()
if (_cycle_timestamp - _last_safety_check >= (unsigned int)1e5) {
_last_safety_check = _cycle_timestamp;
/**
* Get and handle the safety status at 10Hz
*/
struct safety_s safety = {};
if (circuit_breaker_enabled("CBRK_IO_SAFETY", CBRK_IO_SAFETY_KEY)) {
/* safety switch disabled, turn LED on solid */
stm32_gpiowrite(GPIO_LED_SAFETY, 0);
_safety_off = true;
} else {
/* read safety switch input at 10Hz */
/* read safety switch input and control safety switch LED at 10Hz */
safety_check_button();
}
/**
* Get and handle the safety status
*/
struct safety_s safety;
safety.timestamp = hrt_absolute_time();
if (_safety_off) {
@@ -1096,7 +1099,6 @@ PX4FMU::cycle()
_to_safety = orb_advertise(ORB_ID(safety), &safety);
}
}
}
#endif
/* check arming state */