Menu system fixes; made state less global
This commit is contained in:
parent
cfc2390b8b
commit
209959e2de
14 changed files with 964 additions and 731 deletions
|
@ -103,8 +103,22 @@ void errorWait() {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the knob value accounting for 4x precision - NB this might not work on other kinds of encoder
|
||||
*/
|
||||
int readKnob(uint8_t n) {
|
||||
return knobs[n].readAndReset();
|
||||
int out = 0;
|
||||
int32_t val = knobs[n].read();
|
||||
if (val > 4) {
|
||||
out = val / 4;
|
||||
} else if (val < -4) {
|
||||
out = val / 4;
|
||||
}
|
||||
|
||||
if (out != 0) {
|
||||
knobs[n].write(0);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int readTouchKey(uint8_t n) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue