1
0
Fork 0

[Keyboard] Flip encoder and fix weird volume behavior for Herringbone Pro (#15423)

Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
Ramon Imbao 2021-12-09 01:38:47 +08:00 committed by GitHub
parent cf9239a882
commit c09837e092
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -48,8 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
/* Encoder pin assignment */ /* Encoder pin assignment */
#define ENCODERS_PAD_A { C2 } #define ENCODERS_PAD_A { C3 }
#define ENCODERS_PAD_B { C3 } #define ENCODERS_PAD_B { C2 }
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5 #define DEBOUNCE 5

View file

@ -88,12 +88,14 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
encoder_cw.pressed = true; encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1); encoder_cw.time = (timer_read() | 1);
action_exec(encoder_cw); action_exec(encoder_cw);
wait_ms(20);
anim_sleep = timer_read32(); anim_sleep = timer_read32();
oled_on(); oled_on();
} else { } else {
encoder_ccw.pressed = true; encoder_ccw.pressed = true;
encoder_ccw.time = (timer_read() | 1); encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw); action_exec(encoder_ccw);
wait_ms(20);
anim_sleep = timer_read32(); anim_sleep = timer_read32();
oled_on(); oled_on();
} }