Skip to content

Commit

Permalink
fix(color): Source selection for curve display (#2894)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshifri authored Dec 21, 2022
1 parent 4ad5d87 commit 458dc04
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions radio/src/gui/colorlcd/curveedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,19 @@ void CurveEdit::onEvent(event_t event)
}
}


void CurveEdit::checkEvents()
{
if (!lockSource) {
int16_t val = getMovedSource(MIXSRC_FIRST_INPUT);
if (val) {
CurveEdit::currentSource = val + 1 - MIXSRC_FIRST_INPUT;
TRACE("source=%d", CurveEdit::currentSource);
if (val > 0) {
if (val > NUM_STICKS + NUM_POTS + NUM_SLIDERS)
CurveEdit::currentSource = val + 1 - MIXSRC_FIRST_INPUT;
else {
CurveEdit::currentSource = expoAddress(val - 1)->srcRaw;
TRACE("Detected source=%d", val);
}
TRACE("Applied source=%d", CurveEdit::currentSource);
}
}
FormField::checkEvents();
Expand Down

0 comments on commit 458dc04

Please sign in to comment.