From 929af7830a6b72ede73c62cd521a897f48b03a36 Mon Sep 17 00:00:00 2001 From: "thomas.stockklauser" Date: Tue, 23 Jul 2019 17:35:40 +0200 Subject: [PATCH] Add Visual Studio Project Structure Fix a compile Issue in wled19_json.ino with Visual Studio / Visual Assist --- wled00/wled19_json.ino | 57 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/wled00/wled19_json.ino b/wled00/wled19_json.ino index b1dca344..254a3dc1 100644 --- a/wled00/wled19_json.ino +++ b/wled00/wled19_json.ino @@ -101,6 +101,35 @@ bool deserializeState(JsonObject root) 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) { 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) { root["ver"] = versionString;