Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test of RGBW Branch #660

Merged
merged 9 commits into from
Oct 31, 2024
Merged

Test of RGBW Branch #660

merged 9 commits into from
Oct 31, 2024

Conversation

davepl
Copy link
Contributor

@davepl davepl commented Oct 28, 2024

Description

Adds RGBW support, tweaks SpiralLamp, adds PlateCover

Contributing requirements

  • I read the contribution guidelines in CONTRIBUTING.md.
  • I understand the BlinkenPerBit metric, and maximized it in this PR.
  • I selected main as the target branch.
  • All code herein is subjected to the license terms in COPYING.txt.

{
_tempEffect = effect;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could swear this functionality existed for the atomic lamp already, but could not find a way to actually set the temp effect, so added this method. Let me know if I missed something that would have obviated the need for it!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can remember, the _tempEffect could only be set through the constructor the whole time. But there is a theoretical chance that the possibility did exist a long time ago, and I removed it because the function wasn't used anywhere - I have done some dead code clean-up over time.

// we'll be showing whole units
const int precision = size >= threshold ? 2 : 0;
// If the size is above the threshold, we want a precision of 2 to show more accurate value
const int precision = size < threshold ? 0 : 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check me here, I could be crazy, but I think this was backwards, so flipping it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm neutral on the matter.

I am bound to remember this exchange if you change your mind about this in a couple of years, though. ;)

else
{
setPixelOnAllChannels(iStart + i, rgb);
}
for (int q = 1; q < everyNth; q++)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems weird, like every pixel it draws the black ones in between? No idea, but am trying not to change too much here, but this might be a bug worth tracking and/or fixing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To the extent I can trace things back (and trust GitHub's blame history), this code was originally submitted by yourself three years ago, probably when this repo was created.

With which I just want to say that you're probably most qualified to have an opinion on this/decide changes are necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense now - it fills in the. pixels that the first loop did not!

src/effects.cpp Outdated Show resolved Hide resolved
_lastPeak1Time[i] = millis();
}
if (_Peaks[i] > _peak2Decay[i])
{
_peak2Decay[i] = _Peaks[i];
_peak2Decay[i] = std::min(_Peaks[i], _peak2Decay[i] + maxIncrease);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a later checkin I fix this to use the individual decay rates 1 and 2 rather than basing them both off 1, but it doesn't impact the display.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Copy link
Collaborator

@rbergen rbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice project/effects upgrade!

I did make a few comments you may want to at least consider.

{
_tempEffect = effect;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can remember, the _tempEffect could only be set through the constructor the whole time. But there is a theoretical chance that the possibility did exist a long time ago, and I removed it because the function wasn't used anywhere - I have done some dead code clean-up over time.

// we'll be showing whole units
const int precision = size >= threshold ? 2 : 0;
// If the size is above the threshold, we want a precision of 2 to show more accurate value
const int precision = size < threshold ? 0 : 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm neutral on the matter.

I am bound to remember this exchange if you change your mind about this in a couple of years, though. ;)

else
{
setPixelOnAllChannels(iStart + i, rgb);
}
for (int q = 1; q < everyNth; q++)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To the extent I can trace things back (and trust GitHub's blame history), this code was originally submitted by yourself three years ago, probably when this repo was created.

With which I just want to say that you're probably most qualified to have an opinion on this/decide changes are necessary.

return ptrSampleBuffer.get();
}

const size_t GetSampleBufferSize() const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be a constexpr function?

_lastPeak1Time[i] = millis();
}
if (_Peaks[i] > _peak2Decay[i])
{
_peak2Decay[i] = _Peaks[i];
_peak2Decay[i] = std::min(_Peaks[i], _peak2Decay[i] + maxIncrease);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

src/effects.cpp Outdated Show resolved Hide resolved
src/effects.cpp Outdated Show resolved Hide resolved
include/gfxbase.h Outdated Show resolved Hide resolved
src/effects.cpp Outdated Show resolved Hide resolved
@rbergen
Copy link
Collaborator

rbergen commented Oct 31, 2024

I'm noting for the record that I've re-enabled the CI build for "heltecv3demo". The problem in PlatformIO that caused the project's build to fail was fixed in platform-espressif32 version 6.9.0.

Copy link
Collaborator

@rbergen rbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your changes. LGTM!

@rbergen rbergen merged commit 6cf79ee into PlummersSoftwareLLC:main Oct 31, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants