Skip to content

Commit

Permalink
Remove some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptisteHudyma committed Aug 8, 2024
1 parent ea09c14 commit 40049ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/system/colors/animations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ void candle(const palette_t& palette, LedStrip& strip) {
const uint8_t minBrighness =
currentStrenght - min(currentStrenght, targetPhaseAmplitude / 2);
const uint8_t maxBrighness =
currentStrenght + min(255 - currentStrenght, targetPhaseAmplitude / 2);
currentStrenght +
min(UINT8_MAX - currentStrenght, targetPhaseAmplitude / 2);

uint8_t brightness = random(minBrighness, maxBrighness);
for (uint16_t i = 0; i < LED_COUNT; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/system/colors/wipes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool dot_wipe_up(const Color& color, const uint32_t duration,
const unsigned long delay =
max(LOOP_UPDATE_PERIOD, duration / (float)LED_COUNT);

if (targetIndex >= 0 and targetIndex < LED_COUNT) {
if (targetIndex < LED_COUNT) {
strip.fadeToBlackBy(fadeOut);
// increment
for (uint32_t increment = LED_COUNT / ceil(duration / delay); increment > 0;
Expand Down

0 comments on commit 40049ae

Please sign in to comment.