mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09:43:34 +08:00
added circuit_breaker_enabled_by_val()
added and using circuit_breaker_enabled_by_val() where possible instead of circuit_breaker_enabled() which search for cbrk parameters by name, which is extensive process.
This commit is contained in:
@@ -53,3 +53,8 @@ bool circuit_breaker_enabled(const char *breaker, int32_t magic)
|
||||
|
||||
return (PX4_PARAM_GET_BYNAME(breaker, &val) == 0) && (val == magic);
|
||||
}
|
||||
|
||||
bool circuit_breaker_enabled_by_val(int32_t breaker_val, int32_t magic)
|
||||
{
|
||||
return (breaker_val == magic);
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern "C" __EXPORT bool circuit_breaker_enabled(const char *breaker, int32_t magic);
|
||||
extern "C" __EXPORT bool circuit_breaker_enabled_by_val(int32_t breaker_val, int32_t magic);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user