Skip to content

Commit 8fecc29

Browse files
committed
LED on by default
1 parent 7f77a76 commit 8fecc29

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

app.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,8 @@ zaf_event_distributor_app_proprietary(event_nc_t *event)
853853
// Fade slowly to white
854854
LedEffectFade_t fade = {
855855
.color = cold_white,
856-
.brightness = FADE_MIN_BRIGHTNESS,
857-
.increasing = true,
856+
.brightness = FADE_MAX_BRIGHTNESS,
857+
.increasing = false,
858858
.ticksPerStep = 2,
859859
.stepSize = 1,
860860
.tickCounter = 0
@@ -870,11 +870,11 @@ zaf_event_distributor_app_proprietary(event_nc_t *event)
870870
case EVENT_APP_CONNECTED: {
871871
if (ledEffectDefault.type == LED_EFFECT_FADE) {
872872
// Stop the animation to indicate that we're connected
873-
ledEffectDefault.effect.fade.stopAtMin = true;
873+
ledEffectDefault.effect.fade.stopAtMax = true;
874874
} else {
875-
// If we were not in fade mode, set the color to black
875+
// If we were not in fade mode, set the color to white
876876
LedEffectSolid_t solid = {
877-
.color = black,
877+
.color = cold_white,
878878
.modified = true
879879
};
880880
ledEffectDefault = (LedEffect_t) {
@@ -990,10 +990,10 @@ zaf_event_distributor_app_proprietary(event_nc_t *event)
990990
// and update the color
991991
LedEffectFade_t fade = ledEffect->effect.fade;
992992

993-
if (fade.brightness <= FADE_DIM_THRESHOLD && fade.stopAtMin) {
993+
if (fade.brightness >= FADE_BRIGHT_THRESHOLD && fade.stopAtMax) {
994994
// Switch to solid mode
995995
LedEffectSolid_t solid = {
996-
.color = black,
996+
.color = fade.color,
997997
.modified = true
998998
};
999999
*ledEffect = (LedEffect_t) {
@@ -1235,8 +1235,8 @@ ApplicationInit(
12351235
};
12361236
set_color_buffer(color);
12371237
} else {
1238-
// Default to off
1239-
set_color_buffer(black);
1238+
// Default to on
1239+
set_color_buffer(cold_white);
12401240
}
12411241

12421242
// Try to restore configuration settings from NVM

app.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ typedef struct LedEffectSolid {
283283
#define FADE_MAX_BRIGHTNESS 0xff
284284
#define FADE_MIN_BRIGHTNESS 25 // Don't turn off while fading, looks odd
285285
// Used to switch from fade to solid when the LED is bright enough
286-
#define FADE_DIM_THRESHOLD 40
286+
#define FADE_BRIGHT_THRESHOLD 0xe0
287287

288288
typedef struct LedEffectFade {
289289
rgb_t color;
@@ -292,7 +292,7 @@ typedef struct LedEffectFade {
292292
uint8_t stepSize;
293293
uint8_t tickCounter;
294294
bool increasing;
295-
bool stopAtMin;
295+
bool stopAtMax;
296296
} LedEffectFade_t;
297297

298298
typedef struct LedEffectBlink {

0 commit comments

Comments
 (0)