Skip to content

Commit

Permalink
Merge pull request Aircoookie#2834 from Aircoookie/async-psave
Browse files Browse the repository at this point in the history
Async preset saving
  • Loading branch information
Aircoookie authored Oct 18, 2022
2 parents d6749d3 + a4c3fd4 commit c982e02
Show file tree
Hide file tree
Showing 18 changed files with 1,876 additions and 1,834 deletions.
4 changes: 2 additions & 2 deletions usermods/multi_relay/usermod_multi_relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ class MultiRelay : public Usermod {

json[F("stat_t")] = "~";
json[F("cmd_t")] = F("~/command");
json[F("pl_off")] = F("off");
json[F("pl_on")] = F("on");
json[F("pl_off")] = "off";
json[F("pl_on")] = "on";
json[F("uniq_id")] = uid;

strcpy(buf, mqttDeviceTopic); //max length: 33 + 7 = 40
Expand Down
18 changes: 9 additions & 9 deletions wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4106,54 +4106,54 @@ uint16_t mode_dancing_shadows(void)

if (spotlights[i].width <= 1) {
if (start >= 0 && start < SEGLEN) {
SEGMENT.blendPixelColor(start, color, 128); // TODO
SEGMENT.blendPixelColor(start, color, 128);
}
} else {
switch (spotlights[i].type) {
case SPOT_TYPE_SOLID:
for (size_t j = 0; j < spotlights[i].width; j++) {
if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO
SEGMENT.blendPixelColor(start + j, color, 128);
}
}
break;

case SPOT_TYPE_GRADIENT:
for (size_t j = 0; j < spotlights[i].width; j++) {
if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, cubicwave8(map(j, 0, spotlights[i].width - 1, 0, 255))); // TODO
SEGMENT.blendPixelColor(start + j, color, cubicwave8(map(j, 0, spotlights[i].width - 1, 0, 255)));
}
}
break;

case SPOT_TYPE_2X_GRADIENT:
for (size_t j = 0; j < spotlights[i].width; j++) {
if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, cubicwave8(2 * map(j, 0, spotlights[i].width - 1, 0, 255))); // TODO
SEGMENT.blendPixelColor(start + j, color, cubicwave8(2 * map(j, 0, spotlights[i].width - 1, 0, 255)));
}
}
break;

case SPOT_TYPE_2X_DOT:
for (size_t j = 0; j < spotlights[i].width; j += 2) {
if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO
SEGMENT.blendPixelColor(start + j, color, 128);
}
}
break;

case SPOT_TYPE_3X_DOT:
for (size_t j = 0; j < spotlights[i].width; j += 3) {
if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO
SEGMENT.blendPixelColor(start + j, color, 128);
}
}
break;

case SPOT_TYPE_4X_DOT:
for (size_t j = 0; j < spotlights[i].width; j += 4) {
if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO
SEGMENT.blendPixelColor(start + j, color, 128);
}
}
break;
Expand All @@ -4163,7 +4163,7 @@ uint16_t mode_dancing_shadows(void)

return FRAMETIME;
}
static const char _data_FX_MODE_DANCING_SHADOWS[] PROGMEM = "Dancing Shadows@!,# of shadows;!,,;!;1d";
static const char _data_FX_MODE_DANCING_SHADOWS[] PROGMEM = "Dancing Shadows@!,# of shadows;!,!,!;!;1d";


/*
Expand Down Expand Up @@ -4524,7 +4524,7 @@ uint16_t mode_perlinmove(void) {

return FRAMETIME;
} // mode_perlinmove()
static const char _data_FX_MODE_PERLINMOVE[] PROGMEM = "Perlin Move@!,# of pixels,fade rate;,!;!;1d";
static const char _data_FX_MODE_PERLINMOVE[] PROGMEM = "Perlin Move@!,# of pixels,fade rate;!,!;!;1d";


/////////////////////////
Expand Down
4 changes: 1 addition & 3 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,9 +1501,7 @@ void WS2812FX::loadCustomPalettes()
CRGBPalette16 targetPalette;
for (int index = 0; index<10; index++) {
char fileName[32];
strcpy_P(fileName, PSTR("/palette"));
sprintf(fileName +8, "%d", index);
strcat(fileName, ".json");
sprintf_P(fileName, PSTR("/palette%d.json"), index);

StaticJsonDocument<1536> pDoc; // barely enough to fit 72 numbers
if (WLED_FS.exists(fileName)) {
Expand Down
2 changes: 1 addition & 1 deletion wled00/bus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class BusDigital : public Bus {
_busPtr = PolyBus::create(_iType, _pins, _len, nr);
_valid = (_busPtr != nullptr);
_colorOrder = bc.colorOrder;
DEBUG_PRINTF("Successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u)\n",nr, _len, bc.type, _pins[0],_pins[1],_iType);
DEBUG_PRINTF("%successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u)\n", _valid?"S":"Uns", nr, _len, bc.type, _pins[0],_pins[1],_iType);
};

inline void show() {
Expand Down
Loading

0 comments on commit c982e02

Please sign in to comment.