Skip to content

Commit

Permalink
Issue ToyKeeper#69: tint_ramp_direction does not get reset when chann…
Browse files Browse the repository at this point in the history
…el mode arg

is changed by manual memory

ToyKeeper#69
  • Loading branch information
SiteRelEnby committed Apr 30, 2024
1 parent 72128b6 commit 5f99db0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ui/anduril/channel-modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ 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

// 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;
}
}
}
// ignore event if we weren't the ones who handled the first frame
if (! active) return EVENT_NOT_HANDLED;
Expand Down

0 comments on commit 5f99db0

Please sign in to comment.