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

@ -35,7 +35,7 @@ bool is_keyboard_master(void) {
static int8_t is_master = -1;
if (is_master < 0) {
while (readPin(SPI_SS_PIN)) {
while (gpio_read_pin(SPI_SS_PIN)) {
if (USB_Device_IsAddressSet()) {
is_master = 1;
return is_master;
@ -53,7 +53,7 @@ bool is_keyboard_master(void) {
}
void keyboard_pre_init_kb(void) {
setPinInputHigh(SPI_SS_PIN);
gpio_set_pin_input_high(SPI_SS_PIN);
keyboard_pre_init_user();
}

View file

@ -53,7 +53,7 @@ bool shake_hands(bool master) {
* alignment. */
if (master) {
writePinLow(SPI_SS_PIN);
gpio_write_pin_low(SPI_SS_PIN);
}
for (i = 0 ; i < 8 ; i += 1) {
@ -64,7 +64,7 @@ bool shake_hands(bool master) {
}
if (master) {
writePinHigh(SPI_SS_PIN);
gpio_write_pin_high(SPI_SS_PIN);
}
} while (i < 8);
@ -176,8 +176,8 @@ void transport_master_init(void) {
* above depends on it and the SPI master driver won't do it
* before we call spi_start(). */
writePinHigh(SPI_SS_PIN);
setPinOutput(SPI_SS_PIN);
gpio_write_pin_high(SPI_SS_PIN);
gpio_set_pin_output(SPI_SS_PIN);
spi_init();
@ -195,10 +195,10 @@ void transport_slave_init(void) {
* they're asserted making the MISO pin an output on both ends and
* leading to potential shorts. */
setPinInputHigh(SPI_SS_PIN);
setPinInput(SPI_SCK_PIN);
setPinInput(SPI_MOSI_PIN);
setPinOutput(SPI_MISO_PIN);
gpio_set_pin_input_high(SPI_SS_PIN);
gpio_set_pin_input(SPI_SCK_PIN);
gpio_set_pin_input(SPI_MOSI_PIN);
gpio_set_pin_output(SPI_MISO_PIN);
SPCR = _BV(SPE);