reorder fnc calls

This commit is contained in:
2018-11-05 15:34:14 +01:00
parent 299f7dae65
commit a940903bd3
2 changed files with 5 additions and 15 deletions

View File

@@ -42,6 +42,10 @@ void PixelPlugin::defaultAnimation() {
void PixelPlugin::activate(Scheduler *userScheduler, Network *network)
{
animation.set(TASK_MILLISECOND * pixelConfig.updateInterval, TASK_FOREVER, bind(&PixelPlugin::animate, this));
userScheduler->addTask(animation);
animation.enable();
subscribe("pixels/colorWheel", bind(&PixelPlugin::colorWheel, this, _1));
subscribe("pixels/color", bind(&PixelPlugin::setColor, this, _1));
subscribe("pixels/color2", bind(&PixelPlugin::setColor2, this, _1));
@@ -50,9 +54,6 @@ void PixelPlugin::activate(Scheduler *userScheduler, Network *network)
subscribe("pixels/brightness", bind(&PixelPlugin::setBrightness, this, _1));
subscribe("pixels/state", bind(&PixelPlugin::setState, this, _1));
animation.set(TASK_MILLISECOND * pixelConfig.updateInterval, TASK_FOREVER, bind(&PixelPlugin::animate, this));
userScheduler->addTask(animation);
animation.enable();
PRINT_MSG(Serial, SPROCKET_TYPE, "NeoPixels activated");
}