1
0
Fork 0

Merge remote-tracking branch 'upstream/master' into develop

This commit is contained in:
fauxpark 2022-02-22 03:04:41 +11:00
commit a44abeb99a
4 changed files with 20 additions and 11 deletions

View file

@ -59,6 +59,10 @@ static uint8_t thisHand, thatHand;
static uint8_t encoder_value[NUMBER_OF_ENCODERS] = {0};
#endif
__attribute__((weak)) void encoder_wait_pullup_charge(void) {
wait_us(100);
}
__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) {
return true;
}
@ -88,7 +92,9 @@ void encoder_init(void) {
for (int i = 0; i < NUMBER_OF_ENCODERS; i++) {
setPinInputHigh(encoders_pad_a[i]);
setPinInputHigh(encoders_pad_b[i]);
}
encoder_wait_pullup_charge();
for (int i = 0; i < NUMBER_OF_ENCODERS; i++) {
encoder_state[i] = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1);
}