Skip to content

Commit

Permalink
colon gradient change, startup animation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcer12 committed Aug 25, 2021
1 parent 0eca581 commit 6bd7b64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 9 additions & 2 deletions Firmware/FLORA_FIRMWARE/VFD_fns.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,30 @@ void ICACHE_RAM_ATTR shiftWriteBytes(volatile byte *data) {

void ICACHE_RAM_ATTR TimerHandler()
{
#if !defined(CLOCK_VERSION_IV12)

// Only one ISR timer is available so if we want the dots to not glitch during wifi connection, we need to put it here...
// speed of the dots depends on refresh frequency of the display
if (enableDotsAnimation) {
int stepCount = dotsAnimationSteps / registersCount;

for (int i = 0; i < registersCount; i++) {
if (dotsAnimationState >= stepCount * i && dotsAnimationState < stepCount * (i + 1)) {
#if defined(CLOCK_VERSION_IV12)
segmentBrightness[i][4] = bri_vals_separate[bri][i];
#else
segmentBrightness[i][7] = bri_vals_separate[bri][i];
#endif
} else {
#if defined(CLOCK_VERSION_IV12)
segmentBrightness[i][4] = 0;
#else
segmentBrightness[i][7] = 0;
#endif
}
}
dotsAnimationState++;
if (dotsAnimationState >= dotsAnimationSteps) dotsAnimationState = 0;
}
#endif

// Normal PWM
for (int i = 0; i < registersCount; i++) {
Expand Down
10 changes: 5 additions & 5 deletions Firmware/FLORA_FIRMWARE/neopixel_fns.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ void updateColonColor(RgbColor color) {

if (json["colon"].as<int>() == 3) {
#ifdef CLOCK_VERSION_IV12
colorMed = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.2);
colorMedLow = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.5);
colorLow = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.8);
colorMed = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.1);
colorMedLow = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.3);
colorLow = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.6);
#else
colorMed = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.5);
colorLow = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.7);
colorMed = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.2);
colorLow = RgbColor::LinearBlend(color, RgbColor(0, 0, 0), 0.4);
#endif
}

Expand Down

0 comments on commit 6bd7b64

Please sign in to comment.