Skip to content

Commit

Permalink
Fixed Issue #56 (Read too far)
Browse files Browse the repository at this point in the history
  • Loading branch information
forkineye committed Aug 10, 2017
1 parent cd54247 commit 8694d21
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ESPixelStick.ino
Original file line number Diff line number Diff line change
Expand Up @@ -837,16 +837,19 @@ void loop() {

// Calculate how much data we need for this buffer
uint16_t dataStop = config.channel_count;
if ((dataStart + config.universe_limit) < dataStop)
dataStop = dataStart + config.universe_limit;
uint16_t channels = htons(packet.property_value_count) - 1;
if (config.universe_limit < channels)
channels = config.universe_limit;
if ((dataStart + channels) < dataStop)
dataStop = dataStart + channels;

// Set the data
uint16_t buffloc = 0;

// ignore data from start of first Universe before channel_start
if (dataStart < 0) {
dataStart = 0;
buffloc = config.channel_start-1;
buffloc = config.channel_start - 1;
}

for (int i = dataStart; i < dataStop; i++) {
Expand Down

0 comments on commit 8694d21

Please sign in to comment.