Browse Source

AP_Notify: Use HAL_CANMANAGER_ENABLED instead of HAL_ENABLE_LIBUAVCAN_DRIVERS

c415-sdk
Siddharth Purohit 4 years ago committed by Peter Barker
parent
commit
895039cdce
  1. 6
      libraries/AP_Notify/AP_Notify.cpp
  2. 4
      libraries/AP_Notify/MMLPlayer.cpp
  3. 2
      libraries/AP_Notify/UAVCAN_RGB_LED.cpp

6
libraries/AP_Notify/AP_Notify.cpp

@ -94,7 +94,7 @@ AP_Notify *AP_Notify::_singleton; @@ -94,7 +94,7 @@ AP_Notify *AP_Notify::_singleton;
#endif // BUILD_DEFAULT_LED_TYPE
#ifndef BUZZER_ENABLE_DEFAULT
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
#if HAL_CANMANAGER_ENABLED
// Enable Buzzer messages over UAVCAN
#define BUZZER_ENABLE_DEFAULT (Notify_Buzz_Builtin | Notify_Buzz_UAVCAN)
#else
@ -320,9 +320,9 @@ void AP_Notify::add_backends(void) @@ -320,9 +320,9 @@ void AP_Notify::add_backends(void)
#endif
break;
case Notify_LED_UAVCAN:
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
#if HAL_CANMANAGER_ENABLED
ADD_BACKEND(new UAVCAN_RGB_LED(0));
#endif // HAL_ENABLE_LIBUAVCAN_DRIVERS
#endif // HAL_CANMANAGER_ENABLED
break;
case Notify_LED_Scripting:

4
libraries/AP_Notify/MMLPlayer.cpp

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
#include <AP_Math/AP_Math.h>
#include <AP_Notify/AP_Notify.h>
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
#if HAL_CANMANAGER_ENABLED
#include <AP_UAVCAN/AP_UAVCAN.h>
#include <AP_CANManager/AP_CANManager.h>
#endif
@ -64,7 +64,7 @@ void MMLPlayer::start_note(float duration, float frequency, float volume) @@ -64,7 +64,7 @@ void MMLPlayer::start_note(float duration, float frequency, float volume)
_note_duration_us = duration*1e6;
hal.util->toneAlarm_set_buzzer_tone(frequency, volume, _note_duration_us/1000U);
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
#if HAL_CANMANAGER_ENABLED
// support CAN buzzers too
uint8_t can_num_drivers = AP::can().get_num_drivers();

2
libraries/AP_Notify/UAVCAN_RGB_LED.cpp

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/system.h>
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
#if HAL_CANMANAGER_ENABLED
#include "UAVCAN_RGB_LED.h"
#include <AP_UAVCAN/AP_UAVCAN.h>

Loading…
Cancel
Save