mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-27 02:04:00 -04:00
AP_Notify: renamed Navio2Led to DiscreteRGBLed
This commit is contained in:
parent
0bd7839b9f
commit
ef4e3aa333
@ -29,7 +29,7 @@
|
||||
#include "ToshibaLED_I2C.h"
|
||||
#include "ToshibaLED_PX4.h"
|
||||
#include "VRBoard_LED.h"
|
||||
#include "Navio2LED.h"
|
||||
#include "DiscreteRGBLed.h"
|
||||
|
||||
// table of user settable parameters
|
||||
const AP_Param::GroupInfo AP_Notify::var_info[] = {
|
||||
@ -80,7 +80,7 @@ struct AP_Notify::notify_events_type AP_Notify::events;
|
||||
ToshibaLED_I2C toshibaled;
|
||||
NotifyDevice *AP_Notify::_devices[] = {&navioled, &toshibaled};
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO2
|
||||
Navio2LED navioled;
|
||||
DiscreteRGBLed navioled;
|
||||
ToshibaLED_I2C toshibaled;
|
||||
NotifyDevice *AP_Notify::_devices[] = {&navioled, &toshibaled};
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Navio2LED driver
|
||||
DiscreteRGBLed driver
|
||||
*/
|
||||
/*
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -14,7 +14,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Navio2LED.h"
|
||||
#include "DiscreteRGBLed.h"
|
||||
|
||||
#define NAVIO_LED_BRIGHT 1 // full brightness
|
||||
#define NAVIO_LED_MEDIUM 1 // medium brightness
|
||||
@ -27,14 +27,14 @@
|
||||
|
||||
extern const AP_HAL::HAL& hal;
|
||||
|
||||
Navio2LED::Navio2LED()
|
||||
DiscreteRGBLed::DiscreteRGBLed()
|
||||
: RGBLed(NAVIO_LED_OFF, NAVIO_LED_BRIGHT, NAVIO_LED_MEDIUM, NAVIO_LED_DIM)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#include <unistd.h>
|
||||
bool Navio2LED::hw_init(void)
|
||||
bool DiscreteRGBLed::hw_init(void)
|
||||
{
|
||||
red_pin = hal.gpio->channel(RED_PIN);
|
||||
green_pin = hal.gpio->channel(GREEN_PIN);
|
||||
@ -52,7 +52,7 @@ bool Navio2LED::hw_init(void)
|
||||
}
|
||||
|
||||
// set_rgb - set color as a combination of red, green and blue values
|
||||
bool Navio2LED::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue)
|
||||
bool DiscreteRGBLed::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
/* We fix the GPIO polarity right here */
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
#include "RGBLed.h"
|
||||
|
||||
class Navio2LED: public RGBLed {
|
||||
class DiscreteRGBLed: public RGBLed {
|
||||
public:
|
||||
Navio2LED();
|
||||
DiscreteRGBLed();
|
||||
|
||||
bool hw_init(void) override;
|
||||
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
|
Loading…
Reference in New Issue
Block a user