123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #include "Sub.h"
- #if AC_FENCE == ENABLED
- void Sub::fence_check()
- {
-
- if (!motors.armed()) {
- return;
- }
- const uint8_t orig_breaches = fence.get_breaches();
-
- const uint8_t new_breaches = fence.check();
-
- if (new_breaches) {
-
- if (fence.get_action() != AC_FENCE_ACTION_REPORT_ONLY) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- AP::logger().Write_Error(LogErrorSubsystem::FAILSAFE_FENCE, LogErrorCode(new_breaches));
- } else if (orig_breaches) {
-
- AP::logger().Write_Error(LogErrorSubsystem::FAILSAFE_FENCE, LogErrorCode::ERROR_RESOLVED);
- }
- }
- #endif
|