From 4c911dce6800b7a85a3ef5bc960466e780d79ef5 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Thu, 28 Sep 2023 21:48:50 +0100 Subject: [PATCH] AP_HAL: Add support for NeoPixelRGB --- libraries/AP_HAL/RCOutput.cpp | 1 + libraries/AP_HAL/RCOutput.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL/RCOutput.cpp b/libraries/AP_HAL/RCOutput.cpp index f28a00de4d..c998f5c156 100644 --- a/libraries/AP_HAL/RCOutput.cpp +++ b/libraries/AP_HAL/RCOutput.cpp @@ -30,6 +30,7 @@ const char* AP_HAL::RCOutput::get_output_mode_string(enum output_mode out_mode) case MODE_PWM_DSHOT1200: return "DS1200"; case MODE_NEOPIXEL: + case MODE_NEOPIXELRGB: return "NeoP"; case MODE_PROFILED: return "ProfiLED"; diff --git a/libraries/AP_HAL/RCOutput.h b/libraries/AP_HAL/RCOutput.h index 0bceccec1b..f4ffd25f5a 100644 --- a/libraries/AP_HAL/RCOutput.h +++ b/libraries/AP_HAL/RCOutput.h @@ -215,6 +215,7 @@ public: MODE_PWM_DSHOT1200, MODE_NEOPIXEL, // same as MODE_PWM_DSHOT at 800kHz but it's an LED MODE_PROFILED, // same as MODE_PWM_DSHOT using separate clock and data + MODE_NEOPIXELRGB, // same as MODE_NEOPIXEL but RGB ordering }; // true when the output mode is of type dshot // static to allow use in the ChibiOS thread stuff @@ -223,6 +224,7 @@ public: static bool is_led_protocol(const enum output_mode mode) { switch (mode) { case MODE_NEOPIXEL: + case MODE_NEOPIXELRGB: case MODE_PROFILED: return true; default: @@ -351,7 +353,7 @@ public: and led number. A led number of -1 means all LEDs. LED 0 is the first LED */ virtual void set_serial_led_rgb_data(const uint16_t chan, int8_t led, uint8_t red, uint8_t green, uint8_t blue) {} - + /* trigger send of serial led */