AP_Notify: rename HAL_OREO_LED_ENABLED to AP_NOTIFY_OREOLED_ENABLED

This commit is contained in:
Peter Barker 2022-11-16 18:56:01 +11:00 committed by Andrew Tridgell
parent 65c22b52cb
commit 6ea352b087
5 changed files with 19 additions and 8 deletions

View File

@ -470,7 +470,7 @@ DMA_PRIORITY USART6* SPI*
ROMFS io_firmware.bin Tools/IO_Firmware/iofirmware_lowpolh.bin
# for users running fmuv3 on their Solo:
define HAL_OREO_LED_ENABLED (BOARD_FLASH_SIZE > 1024)
define AP_NOTIFY_OREOLED_ENABLED (BOARD_FLASH_SIZE > 1024)
define HAL_SOLO_GIMBAL_ENABLED (HAL_MOUNT_ENABLED && BOARD_FLASH_SIZE > 1024)
# produce this error if we are on a 1M board

View File

@ -176,7 +176,7 @@ const AP_Param::GroupInfo AP_Notify::var_info[] = {
AP_GROUPINFO("DISPLAY_TYPE", 3, AP_Notify, _display_type, 0),
#endif
#if HAL_OREO_LED_ENABLED
#if AP_NOTIFY_OREOLED_ENABLED
// @Param: OREO_THEME
// @DisplayName: OreoLED Theme
// @Description: Enable/Disable Solo Oreo LED driver, 0 to disable, 1 for Aircraft theme, 2 for Rover theme
@ -335,7 +335,7 @@ void AP_Notify::add_backends(void)
ADD_BACKEND(new ProfiLED_SPI());
break;
case Notify_LED_OreoLED:
#if HAL_OREO_LED_ENABLED
#if AP_NOTIFY_OREOLED_ENABLED
if (_oreo_theme) {
ADD_BACKEND(new OreoLED_I2C(0, _oreo_theme));
}

View File

@ -24,3 +24,7 @@
#ifndef AP_NOTIFY_TOSHIBALED_ENABLED
#define AP_NOTIFY_TOSHIBALED_ENABLED 1
#endif
#ifndef AP_NOTIFY_OREOLED_ENABLED
#define AP_NOTIFY_OREOLED_ENABLED 0
#endif

View File

@ -17,11 +17,14 @@
but with some components from orleod.cpp from px4 firmware
*/
#include "OreoLED_I2C.h"
#if AP_NOTIFY_OREOLED_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/I2CDevice.h>
#include <AP_BoardConfig/AP_BoardConfig.h>
#include "OreoLED_I2C.h"
#include "AP_Notify.h"
#include <utility>
@ -709,3 +712,5 @@ bool OreoLED_I2C::oreo_state::operator==(const OreoLED_I2C::oreo_state &os) cons
&& (os.amplitude_red==amplitude_red) && (os.amplitude_green==amplitude_green) && (os.amplitude_blue==amplitude_blue)
&& (os.period==period) && (os.repeat==repeat) && (os.phase_offset==phase_offset));
}
#endif // AP_NOTIFY_OREOLED_ENABLED

View File

@ -16,13 +16,13 @@
*/
#pragma once
#include "AP_Notify_config.h"
#if AP_NOTIFY_OREOLED_ENABLED
#include <AP_HAL/AP_HAL.h>
#include "NotifyDevice.h"
#ifndef HAL_OREO_LED_ENABLED
#define HAL_OREO_LED_ENABLED 0
#endif
#define OREOLED_NUM_LEDS 4 // maximum number of individual LEDs connected to the oreo led cpu
#define OREOLED_INSTANCE_ALL 0xff // instance number to indicate all LEDs (used for set_rgb and set_macro)
#define OREOLED_BRIGHT 0xff // maximum brightness when flying (disconnected from usb)
@ -202,3 +202,5 @@ private:
uint32_t _last_boot_ms;
uint32_t _last_sync_ms;
};
#endif // AP_NOTIFY_OREOLED_ENABLED