aboutsummaryrefslogtreecommitdiff
path: root/common_features.mk
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-02-15 08:56:13 +1100
committerGitHub <noreply@github.com>2021-02-15 08:56:13 +1100
commitf53e41ac81662a560a299a23c7863dd2f618a1f8 (patch)
treefcdaf9afd383e537571cc53ef644ba9504e274ec /common_features.mk
parentc27a778281824423a324d04276d291f06b49b1ae (diff)
downloadqmk_firmware-f53e41ac81662a560a299a23c7863dd2f618a1f8.tar.gz
qmk_firmware-f53e41ac81662a560a299a23c7863dd2f618a1f8.zip
Add support for analog USBPD on STM32G4xx. (#11824)
* Add support for analog USBPD on STM32G4xx. * Split up to a list of driver types, allow for custom.
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk24
1 files changed, 24 insertions, 0 deletions
diff --git a/common_features.mk b/common_features.mk
index ecb4f5576..8338ce408 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -631,3 +631,27 @@ endif
631ifeq ($(strip $(JOYSTICK_ENABLE)), digital) 631ifeq ($(strip $(JOYSTICK_ENABLE)), digital)
632 OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE 632 OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE
633endif 633endif
634
635USBPD_ENABLE ?= no
636VALID_USBPD_DRIVER_TYPES = custom vendor
637USBPD_DRIVER ?= vendor
638ifeq ($(strip $(USBPD_ENABLE)), yes)
639 ifeq ($(filter $(strip $(USBPD_DRIVER)),$(VALID_USBPD_DRIVER_TYPES)),)
640 $(error USBPD_DRIVER="$(USBPD_DRIVER)" is not a valid USBPD driver)
641 else
642 OPT_DEFS += -DUSBPD_ENABLE
643 ifeq ($(strip $(USBPD_DRIVER)), vendor)
644 # Vendor-specific implementations
645 OPT_DEFS += -DUSBPD_VENDOR
646 ifeq ($(strip $(MCU_SERIES)), STM32G4xx)
647 OPT_DEFS += -DUSBPD_STM32G4
648 SRC += usbpd_stm32g4.c
649 else
650 $(error There is no vendor-provided USBPD driver available)
651 endif
652 else ifeq ($(strip $(USBPD_DRIVER)), custom)
653 OPT_DEFS += -DUSBPD_CUSTOM
654 # Board designers can add their own driver to $(SRC)
655 endif
656 endif
657endif \ No newline at end of file