diff options
| author | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-09-29 13:56:35 +0700 |
|---|---|---|
| committer | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-09-29 14:08:42 +0700 |
| commit | b30731ff6cad0b7d00f50c511b3ed3c0ca13a6b2 (patch) | |
| tree | dd120b452be2a2fa653bd8602aec199b93ab51c2 | |
| parent | 68e4ce488d0a011c2e03c631b5cc0c24dff7e1f8 (diff) | |
feat: add build option for usb-c version
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | src/leddrv.c | 4 |
2 files changed, 10 insertions, 0 deletions
@@ -9,6 +9,8 @@ TARGET = badgemagic-ch582 ###################################### # Uncomment below line to enable debugging # DEBUG = 1 +# Uncomment below to build for USB-C version +# USBC_VERSION = 1 # optimization for size OPT = -Os @@ -120,6 +122,10 @@ ifeq ($(DEBUG), 1) CFLAGS += -g -gdwarf-2 -DDEBUG=$(DEBUG) endif +ifeq ($(USBC_VERSION), 1) +CFLAGS += -DUSBC_VERSION=$(USBC_VERSION) +endif + # Generate dependency information CFLAGS += -MMD -MP diff --git a/src/leddrv.c b/src/leddrv.c index ebf0edd..4a428ba 100644 --- a/src/leddrv.c +++ b/src/leddrv.c @@ -88,7 +88,11 @@ static const pinctrl_t led_pins[LED_PINCOUNT] = { PINCTRL(B, 4), // Q PINCTRL(B, 2), // R PINCTRL(B, 1), // S +#ifdef USBC_VERSION + PINCTRL(B, 6), // T +#else PINCTRL(B, 23), // T +#endif PINCTRL(B, 21), // U PINCTRL(B, 20), // V PINCTRL(B, 19), // W |