mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
enable disarmed PWM and rework safety switch disable logic
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user