Browse Source

AP_Notify: move to using CANManager library

c415-sdk
Siddharth Purohit 5 years ago committed by Andrew Tridgell
parent
commit
81c7099848
  1. 4
      libraries/AP_Notify/AP_Notify.cpp
  2. 6
      libraries/AP_Notify/MMLPlayer.cpp
  3. 4
      libraries/AP_Notify/UAVCAN_RGB_LED.cpp

4
libraries/AP_Notify/AP_Notify.cpp

@ -283,9 +283,9 @@ void AP_Notify::add_backends(void) @@ -283,9 +283,9 @@ void AP_Notify::add_backends(void)
#endif
break;
case Notify_LED_UAVCAN:
#if HAL_WITH_UAVCAN
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
ADD_BACKEND(new UAVCAN_RGB_LED(0));
#endif // HAL_WITH_UAVCAN
#endif // HAL_ENABLE_LIBUAVCAN_DRIVERS
break;
}

6
libraries/AP_Notify/MMLPlayer.cpp

@ -6,9 +6,9 @@ @@ -6,9 +6,9 @@
#include <AP_Math/AP_Math.h>
#include <AP_Notify/AP_Notify.h>
#if HAL_WITH_UAVCAN
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
#include <AP_UAVCAN/AP_UAVCAN.h>
#include <AP_BoardConfig/AP_BoardConfig_CAN.h>
#include <AP_CANManager/AP_CANManager.h>
#endif
extern const AP_HAL::HAL& hal;
@ -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_WITH_UAVCAN
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
// support CAN buzzers too
uint8_t can_num_drivers = AP::can().get_num_drivers();

4
libraries/AP_Notify/UAVCAN_RGB_LED.cpp

@ -17,12 +17,12 @@ @@ -17,12 +17,12 @@
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/system.h>
#if HAL_WITH_UAVCAN
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
#include "UAVCAN_RGB_LED.h"
#include <AP_UAVCAN/AP_UAVCAN.h>
#include <AP_BoardConfig/AP_BoardConfig_CAN.h>
#include <AP_CANManager/AP_CANManager.h>
#define LED_OFF 0
#define LED_FULL_BRIGHT 255

Loading…
Cancel
Save