1
0
Fork 0

Update GPIO API usage in keyboard code (#23361)

This commit is contained in:
Ryan 2024-05-03 15:21:29 +10:00 committed by GitHub
parent 5426a7a129
commit d09a06a1b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
390 changed files with 3912 additions and 3913 deletions

View file

@ -15,12 +15,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void keyboard_pre_init_kb(void) {
// Encoder pins
setPinInput(PIN_TW_SW);
setPinInput(PIN_RJ_SW);
setPinInput(PIN_RJ_DIR_A);
setPinInput(PIN_RJ_DIR_C);
setPinInput(PIN_RJ_DIR_B);
setPinInput(PIN_RJ_DIR_D);
gpio_set_pin_input(PIN_TW_SW);
gpio_set_pin_input(PIN_RJ_SW);
gpio_set_pin_input(PIN_RJ_DIR_A);
gpio_set_pin_input(PIN_RJ_DIR_C);
gpio_set_pin_input(PIN_RJ_DIR_B);
gpio_set_pin_input(PIN_RJ_DIR_D);
keyboard_pre_init_user();
}
@ -40,18 +40,18 @@ int16_t enc2RightPrev = 1;
void matrix_scan_kb(void) {
enc1CenterPrev = enc1Center;
enc1Center = readPin(PIN_TW_SW);
enc1Center = gpio_read_pin(PIN_TW_SW);
enc2CenterPrev = enc2Center;
enc2Center = readPin(PIN_RJ_SW);
enc2Center = gpio_read_pin(PIN_RJ_SW);
enc2UpPrev = enc2Up;
enc2Up = readPin(PIN_RJ_DIR_A);
enc2Up = gpio_read_pin(PIN_RJ_DIR_A);
enc2DownPrev = enc2Down;
enc2Down = readPin(PIN_RJ_DIR_C);
enc2Down = gpio_read_pin(PIN_RJ_DIR_C);
enc2LeftPrev = enc2Left;
enc2Left = readPin(PIN_RJ_DIR_B);
enc2Left = gpio_read_pin(PIN_RJ_DIR_B);
enc2RightPrev = enc2Right;
enc2Right = readPin(PIN_RJ_DIR_D);
enc2Right = gpio_read_pin(PIN_RJ_DIR_D);
// Ensure any user customizations are called (for some reason this wasn't happening by default)
matrix_scan_user();