Skip to content

Commit d7ef8e1

Browse files
committed
Fix PHY type definition in GD32 build
Move the Ethernet PHY selection from the hard-coded COPS flags into the common DEFINES list. This keeps PHY_TYPE included in the compiler defines consistently across build variants and avoids missing or inconsistent PHY configuration in the GD32 firmware template.
1 parent 92dcf8b commit d7ef8e1

2 files changed

Lines changed: 118 additions & 1 deletion

File tree

firmware-template-gd32/Rules.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PROJECT=$(notdir $(patsubst %/,%,$(CURDIR)))
2525
$(info $$PROJECT [${PROJECT}])
2626

2727
DEFINES:=$(addprefix -D,$(DEFINES))
28+
DEFINES+=-DPHY_TYPE=$(ENET_PHY)
2829

2930
include ../common/make/gd32/Board.mk
3031
include ../common/make/gd32/Mcu.mk
@@ -59,7 +60,7 @@ else
5960
DEFINES+=-DCONFIG_NETWORK_MEMORY_BLOCKS=16
6061
endif
6162

62-
COPS=-DGD32 -D$(FAMILY_UCA) -D$(LINE_UC) -D$(MCU) -D$(BOARD) -DPHY_TYPE=$(ENET_PHY)
63+
COPS=-DGD32 -D$(FAMILY_UCA) -D$(LINE_UC) -D$(MCU) -D$(BOARD)
6364
COPS+=$(sort $(DEFINES) $(MAKE_FLAGS))
6465
COPS+=$(strip $(INCLUDES) $(LIBINCDIRS))
6566
COPS+=$(strip $(ARMOPS) $(CMSISOPS))
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"type_info": [
3+
{
4+
"name": "WS2801",
5+
"protocol_type": "spi",
6+
"led_count": 3,
7+
"default_hz": 4000000,
8+
"max_hz": 25000000,
9+
"led_map": "RGB"
10+
},
11+
{
12+
"name": "WS2811",
13+
"protocol_type": "rtz",
14+
"led_count": 3,
15+
"low_code": 192,
16+
"high_code": 240,
17+
"led_map": "RGB"
18+
},
19+
{
20+
"name": "WS2812",
21+
"protocol_type": "rtz",
22+
"led_count": 3,
23+
"low_code": 192,
24+
"high_code": 240,
25+
"led_map": "GRB"
26+
},
27+
{
28+
"name": "WS2812B",
29+
"protocol_type": "rtz",
30+
"led_count": 3,
31+
"low_code": 192,
32+
"high_code": 248,
33+
"led_map": "GRB"
34+
},
35+
{
36+
"name": "WS2813",
37+
"protocol_type": "rtz",
38+
"led_count": 3,
39+
"low_code": 192,
40+
"high_code": 240,
41+
"led_map": "GRB"
42+
},
43+
{
44+
"name": "WS2815",
45+
"protocol_type": "rtz",
46+
"led_count": 3,
47+
"low_code": 192,
48+
"high_code": 240,
49+
"led_map": "GRB"
50+
},
51+
{
52+
"name": "SK6812",
53+
"protocol_type": "rtz",
54+
"led_count": 3,
55+
"low_code": 192,
56+
"high_code": 240,
57+
"led_map": "GRB"
58+
},
59+
{
60+
"name": "SK6812W",
61+
"protocol_type": "rtz",
62+
"led_count": 4,
63+
"low_code": 192,
64+
"high_code": 240,
65+
"led_map": "RGBW"
66+
},
67+
{
68+
"name": "UCS1903",
69+
"protocol_type": "rtz",
70+
"led_count": 3,
71+
"low_code": 192,
72+
"high_code": 252,
73+
"led_map": "BRG"
74+
},
75+
{
76+
"name": "UCS2903",
77+
"protocol_type": "rtz",
78+
"led_count": 3,
79+
"low_code": 192,
80+
"high_code": 252,
81+
"led_map": "RGB"
82+
},
83+
{
84+
"name": "CS8812",
85+
"protocol_type": "rtz",
86+
"led_count": 3,
87+
"low_code": 192,
88+
"high_code": 252,
89+
"led_map": "BGR"
90+
},
91+
{
92+
"name": "APA102",
93+
"protocol_type": "spi",
94+
"led_count": 3,
95+
"default_hz": 4000000,
96+
"max_hz": 25000000,
97+
"led_map": "RGB"
98+
},
99+
{
100+
"name": "SK9822",
101+
"protocol_type": "spi",
102+
"led_count": 3,
103+
"default_hz": 4000000,
104+
"max_hz": 25000000,
105+
"led_map": "RGB"
106+
},
107+
{
108+
"name": "P9813",
109+
"protocol_type": "spi",
110+
"led_count": 3,
111+
"default_hz": 4000000,
112+
"max_hz": 25000000,
113+
"led_map": "RGB"
114+
}
115+
]
116+
}

0 commit comments

Comments
 (0)