diff options
author | Nick Brassel <nick@tzarc.org> | 2021-02-15 08:56:13 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-15 08:56:13 +1100 |
commit | f53e41ac81662a560a299a23c7863dd2f618a1f8 (patch) | |
tree | fcdaf9afd383e537571cc53ef644ba9504e274ec /common_features.mk | |
parent | c27a778281824423a324d04276d291f06b49b1ae (diff) | |
download | qmk_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.mk | 24 |
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 | |||
631 | ifeq ($(strip $(JOYSTICK_ENABLE)), digital) | 631 | ifeq ($(strip $(JOYSTICK_ENABLE)), digital) |
632 | OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE | 632 | OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE |
633 | endif | 633 | endif |
634 | |||
635 | USBPD_ENABLE ?= no | ||
636 | VALID_USBPD_DRIVER_TYPES = custom vendor | ||
637 | USBPD_DRIVER ?= vendor | ||
638 | ifeq ($(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 | ||
657 | endif \ No newline at end of file | ||