If using an old sketch, ignore LayerCount

If it's an old sketch, LayerCount will default to 0, so in order for
Layer.on() to function, don't bother checking for out-of-bounds if
LayerCount == 0.
pull/244/head
Michael Richters 7 years ago
parent 2784d0e9a9
commit 36b461a99a

@ -129,9 +129,8 @@ void Layer_::move(uint8_t layer) {
void Layer_::on(uint8_t layer) {
// If we're trying to turn on a layer that doesn't exist; abort
if (layer >= LayerCount) {
if (LayerCount != 0 && layer >= LayerCount)
return;
}
bool wasOn = isOn(layer);

Loading…
Cancel
Save