Skip to content

Commit

Permalink
feat: add build option for usb-c version
Browse files Browse the repository at this point in the history
  • Loading branch information
kienvo committed Sep 29, 2024
1 parent 68e4ce4 commit b30731f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/leddrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b30731f

Please sign in to comment.