uavcan: skip beep if CBRK_BUZZER circuit breaker set

This commit is contained in:
Daniel Agar
2021-04-05 10:09:10 -04:00
parent 8e8826c516
commit e8d98c1f8a
+7
View File
@@ -39,6 +39,8 @@
#include "beep.hpp"
#include <lib/circuit_breaker/circuit_breaker.h>
UavcanBeep::UavcanBeep(uavcan::INode &node) :
_beep_pub(node),
_timer(node)
@@ -47,6 +49,11 @@ UavcanBeep::UavcanBeep(uavcan::INode &node) :
int UavcanBeep::init()
{
// don't initialize if CBRK_BUZZER circuit breaker is enabled.
if (circuit_breaker_enabled("CBRK_BUZZER", CBRK_BUZZER_KEY)) {
return 0;
}
/*
* Setup timer and call back function for periodic updates
*/