Add Visual Studio Project Structure

Fix a compile Issue in wled19_json.ino with Visual Studio / Visual Assist
This commit is contained in:
thomas.stockklauser 2019-07-23 17:35:40 +02:00
parent 13062cf0e4
commit 929af7830a

View File

@ -101,6 +101,35 @@ bool deserializeState(JsonObject root)
return stateResponse; return stateResponse;
} }
void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id)
{
root["id"] = id;
root["start"] = seg.start;
root["stop"] = seg.stop;
root["len"] = seg.stop - seg.start;
JsonArray colarr = root.createNestedArray("col");
for (uint8_t i = 0; i < 3; i++)
{
JsonArray colX = colarr.createNestedArray();
colX.add((seg.colors[i] >> 16) & 0xFF);
colX.add((seg.colors[i] >> 8) & 0xFF);
colX.add((seg.colors[i]) & 0xFF);
if (useRGBW)
colX.add((seg.colors[i] >> 24) & 0xFF);
}
root["fx"] = seg.mode;
root["sx"] = seg.speed;
root["ix"] = seg.intensity;
root["pal"] = seg.palette;
root["sel"] = seg.isSelected();
root["rev"] = seg.getOption(1);
root["cln"] = -1;
}
void serializeState(JsonObject root) void serializeState(JsonObject root)
{ {
root["on"] = (bri > 0); root["on"] = (bri > 0);
@ -132,34 +161,6 @@ void serializeState(JsonObject root)
} }
} }
void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id)
{
root["id"] = id;
root["start"] = seg.start;
root["stop"] = seg.stop;
root["len"] = seg.stop - seg.start;
JsonArray colarr = root.createNestedArray("col");
for (uint8_t i = 0; i < 3; i++)
{
JsonArray colX = colarr.createNestedArray();
colX.add((seg.colors[i] >> 16) & 0xFF);
colX.add((seg.colors[i] >> 8) & 0xFF);
colX.add((seg.colors[i] ) & 0xFF);
if (useRGBW)
colX.add((seg.colors[i] >> 24) & 0xFF);
}
root["fx"] = seg.mode;
root["sx"] = seg.speed;
root["ix"] = seg.intensity;
root["pal"] = seg.palette;
root["sel"] = seg.isSelected();
root["rev"] = seg.getOption(1);
root["cln"] = -1;
}
void serializeInfo(JsonObject root) void serializeInfo(JsonObject root)
{ {
root["ver"] = versionString; root["ver"] = versionString;