Merge remote-tracking branch 'origin/develop' into xap
This commit is contained in:
commit
2064651e27
1 changed files with 21 additions and 10 deletions
|
@ -163,7 +163,14 @@ static bool encoder_update(uint8_t index, uint8_t state) {
|
|||
index += thisHand;
|
||||
#endif
|
||||
encoder_pulses[i] += encoder_LUT[state & 0xF];
|
||||
|
||||
#ifdef ENCODER_DEFAULT_POS
|
||||
if ((encoder_pulses[i] >= resolution) || (encoder_pulses[i] <= -resolution) || ((state & 0x3) == ENCODER_DEFAULT_POS)) {
|
||||
if (encoder_pulses[i] >= 1) {
|
||||
#else
|
||||
if (encoder_pulses[i] >= resolution) {
|
||||
#endif
|
||||
|
||||
encoder_value[index]++;
|
||||
changed = true;
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
|
@ -172,7 +179,12 @@ static bool encoder_update(uint8_t index, uint8_t state) {
|
|||
encoder_update_kb(index, ENCODER_COUNTER_CLOCKWISE);
|
||||
#endif // ENCODER_MAP_ENABLE
|
||||
}
|
||||
|
||||
#ifdef ENCODER_DEFAULT_POS
|
||||
if (encoder_pulses[i] <= -1) {
|
||||
#else
|
||||
if (encoder_pulses[i] <= -resolution) { // direction is arbitrary here, but this clockwise
|
||||
#endif
|
||||
encoder_value[index]--;
|
||||
changed = true;
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
|
@ -183,7 +195,6 @@ static bool encoder_update(uint8_t index, uint8_t state) {
|
|||
}
|
||||
encoder_pulses[i] %= resolution;
|
||||
#ifdef ENCODER_DEFAULT_POS
|
||||
if ((state & 0x3) == ENCODER_DEFAULT_POS) {
|
||||
encoder_pulses[i] = 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue