summaryrefslogtreecommitdiff
path: root/quantum/backlight
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-09-15 02:19:51 +0100
committerGitHub <noreply@github.com>2021-09-15 11:19:51 +1000
commita78f0e8a0ba869681d636457f30e668e34853cb7 (patch)
tree1b9b4a6a6eb97dc433e2bec397e579e96086b4bc /quantum/backlight
parentb56282756b5faa410301de8c4ecdcae0e0148652 (diff)
Refactor use of _STM32_ defines (#14439)
Diffstat (limited to 'quantum/backlight')
-rw-r--r--quantum/backlight/backlight_chibios.c10
1 files changed, 7 insertions, 3 deletions
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