Skip to content

Commit

Permalink
Added missing pixel prefix information.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMueller2003 committed Jan 11, 2024
1 parent 660057f commit 92e4ecd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ESPixelStick/src/output/OutputPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ void c_OutputPixel::StartNewFrame ()
FrameAppendDataCurrentIndex = 0;
SentPixelsCount = 0;
PixelIntensityCurrentIndex = 0;
PixelIntensityCurrentColor = 0;
PrependNullPixelCurrentCount = 0;
AppendNullPixelCurrentCount = 0;
PixelPrependDataCurrentIndex = 0;
Expand Down Expand Up @@ -447,6 +448,8 @@ uint32_t IRAM_ATTR c_OutputPixel::FramePrependData()
}
// PixelIntensityCurrentIndex = 0;
// PixelPrependDataCurrentIndex = 0;
// PixelIntensityCurrentColor = 0;

}
return response;
}
Expand Down Expand Up @@ -476,6 +479,7 @@ uint32_t IRAM_ATTR c_OutputPixel::PixelPrependNulls()
// pixel is complete. Move to the next one
PixelIntensityCurrentIndex = 0;
PixelPrependDataCurrentIndex = 0;
PixelIntensityCurrentColor = 0;

if (++PrependNullPixelCurrentCount < PrependNullPixelCount)
{
Expand Down Expand Up @@ -504,6 +508,9 @@ uint32_t IRAM_ATTR c_OutputPixel::PixelSendPrependIntensity()
// pixel prepend goes here
if (PixelPrependDataCurrentIndex >= PixelPrependDataSize)
{
// reset the prepend index for the next pixel
PixelPrependDataCurrentIndex = 0;

#ifdef SUPPORT_OutputType_GECE
if (OutputType == OTYPE_t::OutputType_GECE)
{
Expand Down Expand Up @@ -589,6 +596,7 @@ uint32_t IRAM_ATTR c_OutputPixel::PixelAppendNulls()
// pixel is complete. Move to the next one
PixelIntensityCurrentIndex = 0;
PixelPrependDataCurrentIndex = 0;
PixelIntensityCurrentColor = 0;

if (++AppendNullPixelCurrentCount < AppendNullPixelCount)
{
Expand Down Expand Up @@ -665,6 +673,7 @@ uint32_t IRAM_ATTR c_OutputPixel::GetIntensityData()
PixelPrependDataCurrentIndex = 0;
PixelIntensityCurrentIndex = 0;
AppendNullPixelCurrentCount = 0;
PixelIntensityCurrentColor = 0;

FrameStateFuncPtr = &c_OutputPixel::PixelAppendNulls;
}
Expand All @@ -681,6 +690,12 @@ uint32_t IRAM_ATTR c_OutputPixel::GetIntensityData()
FrameStateFuncPtr = &c_OutputPixel::FrameDone;
}
}
// are we at the end of a pixel and are we prepending pixel data?
else if(++PixelIntensityCurrentColor >= NumIntensityBytesPerPixel)
{
PixelIntensityCurrentColor = 0;
SetStartingSendPixelState();
}

return response;
}
Expand Down
1 change: 1 addition & 0 deletions ESPixelStick/src/output/OutputPixel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class c_OutputPixel : public c_OutputCommon
uint32_t pixel_count = 100;
uint32_t SentPixelsCount = 0;
uint32_t PixelIntensityCurrentIndex = 0;
uint32_t PixelIntensityCurrentColor = 0;

uint8_t * pFramePrependData = nullptr;
uint32_t FramePrependDataSize = 0;
Expand Down

0 comments on commit 92e4ecd

Please sign in to comment.