Skip to content

Commit

Permalink
Merge pull request #4 from wb-Joy/gmmk_v2_keyboard
Browse files Browse the repository at this point in the history
Optimize the code
  • Loading branch information
Joy Lee authored Mar 14, 2022
2 parents a115419 + 4d65006 commit 696d4d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions keyboards/gmmk/gmmk2/p96/wb32_spi_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ void spi_init(void) {

chThdSleepMilliseconds(10);

palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3);
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
PAL_PORT(SPI_SCK_PIN)->CFGMSK = ~(1 << PAL_PAD(SPI_SCK_PIN));
PAL_PORT(SPI_SCK_PIN)->CURRENT = 0x03;
}
}
4 changes: 1 addition & 3 deletions keyboards/gmmk/gmmk2/src/wb32_spi_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0};

chThdSleepMilliseconds(10);

palSetPadMode(PAL_PORT(WB32_SPI_SCK_PIN), PAL_PAD(WB32_SPI_SCK_PIN), PAL_MODE_ALTERNATE(WB32_SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
palSetPadMode(PAL_PORT(WB32_SPI_SCK_PIN), PAL_PAD(WB32_SPI_SCK_PIN), PAL_MODE_ALTERNATE(WB32_SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3);
palSetPadMode(PAL_PORT(WB32_SPI_MOSI_PIN), PAL_PAD(WB32_SPI_MOSI_PIN), PAL_MODE_ALTERNATE(WB32_SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
palSetPadMode(PAL_PORT(WB32_SPI_MISO_PIN), PAL_PAD(WB32_SPI_MISO_PIN), PAL_MODE_ALTERNATE(WB32_SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
PAL_PORT(WB32_SPI_SCK_PIN)->CFGMSK = ~(1 << PAL_PAD(WB32_SPI_SCK_PIN));
PAL_PORT(WB32_SPI_SCK_PIN)->CURRENT = 0x03;
}
}

Expand Down

0 comments on commit 696d4d6

Please sign in to comment.