From cc3823f767a704cc465fbfdfef5d272aab018bd0 Mon Sep 17 00:00:00 2001 From: HorrorTroll Date: Sat, 4 Jan 2025 03:33:22 +0700 Subject: [PATCH] Update some changes for AT32F415 (#24766) * Fixed SPI can't compiled issue * Added solenoid support and use 256KB ldscript for Onekey board --- keyboards/handwired/onekey/at_start_f415/config.h | 4 ++++ keyboards/handwired/onekey/at_start_f415/rules.mk | 1 + platforms/chibios/drivers/spi_master.c | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 keyboards/handwired/onekey/at_start_f415/rules.mk diff --git a/keyboards/handwired/onekey/at_start_f415/config.h b/keyboards/handwired/onekey/at_start_f415/config.h index 266e45dd0046..0e47e813c575 100644 --- a/keyboards/handwired/onekey/at_start_f415/config.h +++ b/keyboards/handwired/onekey/at_start_f415/config.h @@ -8,3 +8,7 @@ #define BACKLIGHT_PWM_DRIVER PWMD5 #define BACKLIGHT_PWM_CHANNEL 1 + +#define SOLENOID_PIN B12 +#define SOLENOID_PINS { B12, B13, B14, B15 } +#define SOLENOID_PINS_ACTIVE_STATE { high, high, low } diff --git a/keyboards/handwired/onekey/at_start_f415/rules.mk b/keyboards/handwired/onekey/at_start_f415/rules.mk new file mode 100644 index 000000000000..7f2fa62b32fb --- /dev/null +++ b/keyboards/handwired/onekey/at_start_f415/rules.mk @@ -0,0 +1 @@ +MCU_LDSCRIPT = AT32F415xC diff --git a/platforms/chibios/drivers/spi_master.c b/platforms/chibios/drivers/spi_master.c index 6417b7077f54..414e5b10a31a 100644 --- a/platforms/chibios/drivers/spi_master.c +++ b/platforms/chibios/drivers/spi_master.c @@ -249,11 +249,11 @@ bool spi_start_extended(spi_start_config_t *start_config) { #elif defined(AT32F415) spiConfig.ctrl1 = 0; - if (lsbFirst) { + if (start_config->lsb_first) { spiConfig.ctrl1 |= SPI_CTRL1_LTF; } - switch (mode) { + switch (start_config->mode) { case 0: break; case 1: