mirror of https://github.com/ArduPilot/ardupilot
AP_SerialLED: added define for LED limit
This commit is contained in:
parent
5ad4ceef71
commit
2277e22bc7
|
@ -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;
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
|
||||
// limit number of LEDs, mostly to keep DMA memory consumption within
|
||||
// reasonable bounds
|
||||
#define AP_SERIALLED_MAX_LEDS 64
|
||||
|
||||
class AP_SerialLED {
|
||||
public:
|
||||
AP_SerialLED();
|
||||
|
|
Loading…
Reference in New Issue