mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 17:38:32 -04:00
AP_Notify: allow up to 64 LEDs on a pin
This commit is contained in:
parent
bde8a6e11b
commit
65c172bbb6
@ -89,7 +89,7 @@ bool NeoPixel::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue)
|
||||
|
||||
for (uint16_t chan=0; chan<16; chan++) {
|
||||
if ((1U<<chan) & enable_mask) {
|
||||
hal.rcout->set_neopixel_rgb_data(chan, (1U<<HAL_NEOPIXEL_COUNT)-1, red, green, blue);
|
||||
hal.rcout->set_neopixel_rgb_data(chan, -1, red, green, blue);
|
||||
}
|
||||
}
|
||||
hal.rcout->neopixel_send();
|
||||
|
@ -39,7 +39,8 @@ SITL_SFML_LED::SITL_SFML_LED():
|
||||
void SITL_SFML_LED::update_serial_LEDs()
|
||||
{
|
||||
static sf::RenderWindow *w;
|
||||
static sf::RectangleShape *leds[16][32];
|
||||
const uint8_t MAX_LEDS = 64;
|
||||
static sf::RectangleShape *leds[16][MAX_LEDS];
|
||||
|
||||
SITL::SITL *sitl = AP::sitl();
|
||||
if (sitl == nullptr || sitl->led.send_counter == 0) {
|
||||
@ -51,7 +52,7 @@ void SITL_SFML_LED::update_serial_LEDs()
|
||||
for (uint8_t i=0; i<16; i++) {
|
||||
max_leds = MAX(max_leds, sitl->led.num_leds[i]);
|
||||
}
|
||||
w = new sf::RenderWindow(sf::VideoMode(32*(serialLED_size+1), 16*(serialLED_size+1)), "SerialLED");
|
||||
w = new sf::RenderWindow(sf::VideoMode(MAX_LEDS*(serialLED_size+1), 16*(serialLED_size+1)), "SerialLED");
|
||||
if (!w) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user