AP_SerialLED: added define for LED limit

This commit is contained in:
Andrew Tridgell committed 2020-02-27 13:12:26 +11:00
1 parent 5ad4ceef71
commit 2277e22bc7
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ AP_SerialLED::AP_SerialLED()
// set number of LEDs per pin
bool AP_SerialLED::set_num_LEDs(uint8_t chan, uint8_t num_leds)
{
if (chan >= 1 && chan <= 16 && num_leds <= 64) {
if (chan >= 1 && chan <= 16 && num_leds <= AP_SERIALLED_MAX_LEDS) {
return hal.rcout->set_neopixel_num_LEDs(chan-1, num_leds);
}
return false;