diff --git a/keyboards/zsa/ergodox_ez/ergodox_ez.c b/keyboards/zsa/ergodox_ez/ergodox_ez.c index df1ab27cbcfe..73b47cdda73f 100644 --- a/keyboards/zsa/ergodox_ez/ergodox_ez.c +++ b/keyboards/zsa/ergodox_ez/ergodox_ez.c @@ -20,19 +20,20 @@ along with this program. If not, see . #include "ergodox_ez.h" #include "bootmagic.h" +#include "gpio.h" keyboard_config_t keyboard_config; __attribute__((weak)) void keyboard_post_init_sub(void) { - setPinOutput(ERGODOX_LED_1_PIN); - setPinOutput(ERGODOX_LED_2_PIN); - setPinOutput(ERGODOX_LED_3_PIN); + gpio_set_pin_output(ERGODOX_LED_1_PIN); + gpio_set_pin_output(ERGODOX_LED_2_PIN); + gpio_set_pin_output(ERGODOX_LED_3_PIN); } void keyboard_post_init_kb(void) { keyboard_post_init_sub(); #ifdef ERGODOX_LED_SHUTOFF_PIN - setPinOutput(ERGODOX_LED_SHUTOFF_PIN); + gpio_set_pin_output(ERGODOX_LED_SHUTOFF_PIN); #endif keyboard_config.raw = eeconfig_read_kb(); @@ -49,25 +50,25 @@ void keyboard_post_init_kb(void) { void ergodox_board_led_on(void) { #ifdef ERGODOX_LED_SHUTOFF_PIN - writePinHigh(ERGODOX_LED_SHUTOFF_PIN); + gpio_write_pin_high(ERGODOX_LED_SHUTOFF_PIN); #endif } __attribute__((weak)) void ergodox_right_led_1_on(void) { - writePinHigh(ERGODOX_LED_1_PIN); + gpio_write_pin_high(ERGODOX_LED_1_PIN); } __attribute__((weak)) void ergodox_right_led_2_on(void) { - writePinHigh(ERGODOX_LED_2_PIN); + gpio_write_pin_high(ERGODOX_LED_2_PIN); } __attribute__((weak)) void ergodox_right_led_3_on(void) { - writePinHigh(ERGODOX_LED_3_PIN); + gpio_write_pin_high(ERGODOX_LED_3_PIN); } void ergodox_board_led_off(void) { #ifdef ERGODOX_LED_SHUTOFF_PIN - writePinLow(ERGODOX_LED_SHUTOFF_PIN); + gpio_write_pin_low(ERGODOX_LED_SHUTOFF_PIN); #else ergodox_right_led_1_off(); ergodox_right_led_2_off(); @@ -76,15 +77,15 @@ void ergodox_board_led_off(void) { } __attribute__((weak)) void ergodox_right_led_1_off(void) { - setPinInput(ERGODOX_LED_1_PIN); + gpio_write_pin_low(ERGODOX_LED_1_PIN); } __attribute__((weak)) void ergodox_right_led_2_off(void) { - setPinInput(ERGODOX_LED_2_PIN); + gpio_write_pin_low(ERGODOX_LED_2_PIN); } __attribute__((weak)) void ergodox_right_led_3_off(void) { - setPinInput(ERGODOX_LED_3_PIN); + gpio_write_pin_low(ERGODOX_LED_3_PIN); } void ergodox_right_led_on(uint8_t led) { diff --git a/keyboards/zsa/ergodox_ez/m32u4/m32u4.c b/keyboards/zsa/ergodox_ez/m32u4/m32u4.c index c20248bce920..07f47682791c 100644 --- a/keyboards/zsa/ergodox_ez/m32u4/m32u4.c +++ b/keyboards/zsa/ergodox_ez/m32u4/m32u4.c @@ -19,18 +19,14 @@ void keyboard_post_init_sub(void) { TCCR1B = 0b00001001; // set and configure fast PWM // (tied to Vcc for hardware convenience) - setPinInput(B4); + gpio_set_pin_input(B4); // unused pins - C7, D4, D5, E6 // set as input with internal pull-up enabled - setPinInputHigh(C7); - setPinInputHigh(D4); - setPinInputHigh(D5); - setPinInputHigh(E6); - - setPinOutput(ERGODOX_LED_1_PIN); - setPinOutput(ERGODOX_LED_2_PIN); - setPinOutput(ERGODOX_LED_3_PIN); + gpio_set_pin_input_high(C7); + gpio_set_pin_input_high(D4); + gpio_set_pin_input_high(D5); + gpio_set_pin_input_high(E6); } #ifdef RGB_MATRIX_ENABLE