diff options
author | Joel Challis <git@zvecr.com> | 2021-09-15 02:19:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 11:19:51 +1000 |
commit | a78f0e8a0ba869681d636457f30e668e34853cb7 (patch) | |
tree | 1b9b4a6a6eb97dc433e2bec397e579e96086b4bc /quantum | |
parent | b56282756b5faa410301de8c4ecdcae0e0148652 (diff) |
Refactor use of _STM32_ defines (#14439)
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/audio/driver_chibios_pwm_hardware.c | 4 | ||||
-rw-r--r-- | quantum/backlight/backlight_chibios.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/quantum/audio/driver_chibios_pwm_hardware.c b/quantum/audio/driver_chibios_pwm_hardware.c index 3c7d89b290..cd40019ee7 100644 --- a/quantum/audio/driver_chibios_pwm_hardware.c +++ b/quantum/audio/driver_chibios_pwm_hardware.c @@ -109,9 +109,9 @@ void audio_driver_initialize(void) { // connect the AUDIO_PIN to the PWM hardware #if defined(USE_GPIOV1) // STM32F103C8 - palSetLineMode(AUDIO_PIN, PAL_MODE_STM32_ALTERNATE_PUSHPULL); + palSetLineMode(AUDIO_PIN, PAL_MODE_ALTERNATE_PUSHPULL); #else // GPIOv2 (or GPIOv3 for f4xx, which is the same/compatible at this command) - palSetLineMode(AUDIO_PIN, PAL_STM32_MODE_ALTERNATE | PAL_STM32_ALTERNATE(AUDIO_PWM_PAL_MODE)); + palSetLineMode(AUDIO_PIN, PAL_MODE_ALTERNATE(AUDIO_PWM_PAL_MODE)); #endif gptStart(&AUDIO_STATE_TIMER, &gptCFG); diff --git a/quantum/backlight/backlight_chibios.c b/quantum/backlight/backlight_chibios.c index 4d5a69e14e..cbb8e44fd5 100644 --- a/quantum/backlight/backlight_chibios.c +++ b/quantum/backlight/backlight_chibios.c @@ -8,9 +8,13 @@ # define BACKLIGHT_LIMIT_VAL 255 #endif +#ifndef SPI_MISO_PAL_MODE +# if defined(USE_GPIOV1) +# define BACKLIGHT_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else // GPIOV2 && GPIOV3 -#ifndef BACKLIGHT_PAL_MODE -# define BACKLIGHT_PAL_MODE 2 +# define BACKLIGHT_PAL_MODE 5 +# endif #endif // GENERIC @@ -70,7 +74,7 @@ static uint32_t rescale_limit_val(uint32_t val) { void backlight_init_ports(void) { #ifdef USE_GPIOV1 - palSetPadMode(PAL_PORT(BACKLIGHT_PIN), PAL_PAD(BACKLIGHT_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL); + palSetPadMode(PAL_PORT(BACKLIGHT_PIN), PAL_PAD(BACKLIGHT_PIN), BACKLIGHT_PAL_MODE); #else palSetPadMode(PAL_PORT(BACKLIGHT_PIN), PAL_PAD(BACKLIGHT_PIN), PAL_MODE_ALTERNATE(BACKLIGHT_PAL_MODE)); #endif |