Skip to content

Commit

Permalink
Manually merge fix for issue ToyKeeper#69, pull request ToyKeeper#70.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwiffo committed Aug 25, 2024
1 parent 3a27982 commit 4cce136
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hw/sofirn/blf-lt1/anduril.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
// party strobe, tac strobe, lightning, candle, bike
#define DEFAULT_STROBE_CHANNELS CM_BOTH,CM_BOTH,CM_AUTO,CM_AUTO,CM_AUTO

// FIXME: This light has a known issue (https://github.com/ToyKeeper/anduril/issues/69)
// but the fix doesn't fit on the t85, so disable it
#undef USE_TINT_RAMP_DIRECTION_FIX

// for consistency with other models
#define USE_SOFT_FACTORY_RESET

13 changes: 13 additions & 0 deletions ui/anduril/channel-modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ uint8_t channel_mode_state(Event event, uint16_t arg) {
if (! arg) {
active = 1; // first frame means this is for us
past_edge_counter = 0; // doesn't start until user hits the edge

#ifdef USE_TINT_RAMP_DIRECTION_FIX // doesn't fit on the original LT1
// Issue 69: if manual memory was set to an arg of 0 or 255, this could result in an incorrect
// ramp direction with the arg resetting, so make sure tint_ramp_direction is set correctly
if (channel_has_args(channel_mode)) {
if (cfg.channel_mode_args[channel_mode] == 0){
tint_ramp_direction = 1;
}
else if (cfg.channel_mode_args[channel_mode] == 255){
tint_ramp_direction = -1;
}
}
#endif
}
// ignore event if we weren't the ones who handled the first frame
if (! active) return EVENT_NOT_HANDLED;
Expand Down
2 changes: 2 additions & 0 deletions ui/anduril/config-default.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,5 @@
// (but allow disabling this feature per build)
#define USE_CHANNEL_PER_STROBE

// We want this bugfix on everything except the original t85 LT1 (because it doesn't fit)
#define USE_TINT_RAMP_DIRECTION_FIX

0 comments on commit 4cce136

Please sign in to comment.