Skip to content

Commit 95d78df

Browse files
EFM32 Make PeripheralPins.c configuration tables weakly defined to be overridable.
See issue "#7424 (comment)"
1 parent 38744b9 commit 95d78df

File tree

9 files changed

+93
-93
lines changed

9 files changed

+93
-93
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/PeripheralPins.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
/************ADC***************/
2727
/* The third "function" value is used to select the correct ADC channel */
28-
const PinMap PinMap_ADC[] = {
28+
const PinMap __attribute__((weak)) PinMap_ADC[] = {
2929
#ifdef ADC0_BASE
3030
{PD0, ADC_0, ADC_SINGLECTRL_INPUTSEL_CH0},
3131
{PD1, ADC_0, ADC_SINGLECTRL_INPUTSEL_CH1},
@@ -40,7 +40,7 @@ const PinMap PinMap_ADC[] = {
4040
};
4141

4242
/************DAC***************/
43-
const PinMap PinMap_DAC[] = {
43+
const PinMap __attribute__((weak)) PinMap_DAC[] = {
4444
#ifdef DAC0_BASE
4545
{PB11, DAC_0, 0},
4646
{PB12, DAC_0, 1},
@@ -49,7 +49,7 @@ const PinMap PinMap_DAC[] = {
4949
};
5050

5151
/************I2C SCL***********/
52-
const PinMap PinMap_I2C_SCL[] = {
52+
const PinMap __attribute__((weak)) PinMap_I2C_SCL[] = {
5353
#ifdef I2C0_BASE
5454
/* I2C0 */
5555
{PA1, I2C_0, 0},
@@ -71,7 +71,7 @@ const PinMap PinMap_I2C_SCL[] = {
7171
};
7272

7373
/************I2C SDA***********/
74-
const PinMap PinMap_I2C_SDA[] = {
74+
const PinMap __attribute__((weak)) PinMap_I2C_SDA[] = {
7575
#ifdef I2C0_BASE
7676
/* I2C0 */
7777
{PA0, I2C_0, 0},
@@ -93,7 +93,7 @@ const PinMap PinMap_I2C_SDA[] = {
9393
};
9494

9595
/************PWM***************/
96-
const PinMap PinMap_PWM[] = {
96+
const PinMap __attribute__((weak)) PinMap_PWM[] = {
9797
#if defined(TIMER_ROUTE_CC0PEN) || defined(TIMER_ROUTEPEN_CC0PEN)
9898
/* PWM0 */
9999
{PA8, PWM_CH0, 0},
@@ -116,7 +116,7 @@ const PinMap PinMap_PWM[] = {
116116
};
117117

118118
/*************SPI**************/
119-
const PinMap PinMap_SPI_MOSI[] = {
119+
const PinMap __attribute__((weak)) PinMap_SPI_MOSI[] = {
120120
#ifdef USART0_BASE
121121
/* USART0 */
122122
{PE10, SPI_0, 0},
@@ -138,7 +138,7 @@ const PinMap PinMap_SPI_MOSI[] = {
138138
{NC , NC , NC}
139139
};
140140

141-
const PinMap PinMap_SPI_MISO[] = {
141+
const PinMap __attribute__((weak)) PinMap_SPI_MISO[] = {
142142
#ifdef USART0_BASE
143143
/* USART0 */
144144
{PE11, SPI_0, 0},
@@ -160,7 +160,7 @@ const PinMap PinMap_SPI_MISO[] = {
160160
{NC , NC , NC}
161161
};
162162

163-
const PinMap PinMap_SPI_CLK[] = {
163+
const PinMap __attribute__((weak)) PinMap_SPI_CLK[] = {
164164
#ifdef USART0_BASE
165165
/* USART0 */
166166
{PE12, SPI_0, 0},
@@ -182,7 +182,7 @@ const PinMap PinMap_SPI_CLK[] = {
182182
{NC , NC , NC}
183183
};
184184

185-
const PinMap PinMap_SPI_CS[] = {
185+
const PinMap __attribute__((weak)) PinMap_SPI_CS[] = {
186186
#ifdef USART0_BASE
187187
/* USART0 */
188188
{PE13, SPI_0, 0},
@@ -205,7 +205,7 @@ const PinMap PinMap_SPI_CS[] = {
205205
};
206206

207207
/************UART**************/
208-
const PinMap PinMap_UART_TX[] = {
208+
const PinMap __attribute__((weak)) PinMap_UART_TX[] = {
209209
#ifdef UART0_BASE
210210
/* UART0 */
211211
{PF6, UART_0, 0},
@@ -253,7 +253,7 @@ const PinMap PinMap_UART_TX[] = {
253253
{NC , NC , NC}
254254
};
255255

256-
const PinMap PinMap_UART_RX[] = {
256+
const PinMap __attribute__((weak)) PinMap_UART_RX[] = {
257257
#ifdef UART0_BASE
258258
/* UART0 */
259259
{PF7, UART_0, 0},

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG/PeripheralPins.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "PeripheralPins.h"
2525

2626
/************ADC***************/
27-
const PinMap PinMap_ADC[] = {
27+
const PinMap __attribute__((weak)) PinMap_ADC[] = {
2828
#ifdef ADC0_BASE
2929
{PD4, ADC_0, ADC_SINGLECTRL_INPUTSEL_CH4},
3030
{PD5, ADC_0, ADC_SINGLECTRL_INPUTSEL_CH5},
@@ -35,7 +35,7 @@ const PinMap PinMap_ADC[] = {
3535
};
3636

3737
/************I2C SCL***********/
38-
const PinMap PinMap_I2C_SCL[] = {
38+
const PinMap __attribute__((weak)) PinMap_I2C_SCL[] = {
3939
#ifdef I2C0_BASE
4040
/* I2C0 */
4141
{PA1, I2C_0, 0},
@@ -49,7 +49,7 @@ const PinMap PinMap_I2C_SCL[] = {
4949
};
5050

5151
/************I2C SDA***********/
52-
const PinMap PinMap_I2C_SDA[] = {
52+
const PinMap __attribute__((weak)) PinMap_I2C_SDA[] = {
5353
#ifdef I2C0_BASE
5454
/* I2C0 */
5555
{PA0, I2C_0, 0},
@@ -62,7 +62,7 @@ const PinMap PinMap_I2C_SDA[] = {
6262
{NC , NC , NC}
6363
};
6464
/************PWM***************/
65-
const PinMap PinMap_PWM[] = {
65+
const PinMap __attribute__((weak)) PinMap_PWM[] = {
6666
#if defined(TIMER_ROUTE_CC0PEN) || defined(TIMER_ROUTEPEN_CC0PEN)
6767
/* PWM0 */
6868
{PA0, PWM_CH0, 0},
@@ -82,7 +82,7 @@ const PinMap PinMap_PWM[] = {
8282
};
8383

8484
/*************SPI**************/
85-
const PinMap PinMap_SPI_MOSI[] = {
85+
const PinMap __attribute__((weak)) PinMap_SPI_MOSI[] = {
8686
#ifdef USART0_BASE
8787
/* USART0 */
8888
{PE10, SPI_0, 0},
@@ -100,7 +100,7 @@ const PinMap PinMap_SPI_MOSI[] = {
100100
{NC , NC , NC}
101101
};
102102

103-
const PinMap PinMap_SPI_MISO[] = {
103+
const PinMap __attribute__((weak)) PinMap_SPI_MISO[] = {
104104
#ifdef USART0_BASE
105105
/* USART0 */
106106
{PE11, SPI_0, 0},
@@ -118,7 +118,7 @@ const PinMap PinMap_SPI_MISO[] = {
118118
{NC , NC , NC}
119119
};
120120

121-
const PinMap PinMap_SPI_CLK[] = {
121+
const PinMap __attribute__((weak)) PinMap_SPI_CLK[] = {
122122
#ifdef USART0_BASE
123123
/* USART0 */
124124
{PE12, SPI_0, 0},
@@ -136,7 +136,7 @@ const PinMap PinMap_SPI_CLK[] = {
136136
{NC , NC , NC}
137137
};
138138

139-
const PinMap PinMap_SPI_CS[] = {
139+
const PinMap __attribute__((weak)) PinMap_SPI_CS[] = {
140140
#ifdef USART0_BASE
141141
/* USART0 */
142142
{PE13, SPI_0, 0},
@@ -154,7 +154,7 @@ const PinMap PinMap_SPI_CS[] = {
154154
};
155155

156156
/************UART**************/
157-
const PinMap PinMap_UART_TX[] = {
157+
const PinMap __attribute__((weak)) PinMap_UART_TX[] = {
158158
#ifdef USART0_BASE
159159
/* USART0 */
160160
{PE10, USART_0, 0},
@@ -179,7 +179,7 @@ const PinMap PinMap_UART_TX[] = {
179179
{NC , NC , NC}
180180
};
181181

182-
const PinMap PinMap_UART_RX[] = {
182+
const PinMap __attribute__((weak)) PinMap_UART_RX[] = {
183183
#ifdef USART0_BASE
184184
/* USART0 */
185185
{PE11, USART_0, 0},

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG/PeripheralPins.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
/************ADC***************/
2727
/* The third "function" value is used to select the correct ADC channel */
28-
const PinMap PinMap_ADC[] = {
28+
const PinMap __attribute__((weak)) PinMap_ADC[] = {
2929
#ifdef ADC0_BASE
3030
{PD0, ADC_0, ADC_SINGLECTRL_INPUTSEL_CH0},
3131
{PD1, ADC_0, ADC_SINGLECTRL_INPUTSEL_CH1},
@@ -40,7 +40,7 @@ const PinMap PinMap_ADC[] = {
4040
};
4141

4242
/************DAC***************/
43-
const PinMap PinMap_DAC[] = {
43+
const PinMap __attribute__((weak)) PinMap_DAC[] = {
4444
#ifdef DAC0_BASE
4545
{PB11, DAC_0, 0},
4646
{PB12, DAC_0, 1},
@@ -49,7 +49,7 @@ const PinMap PinMap_DAC[] = {
4949
};
5050

5151
/************I2C SCL***********/
52-
const PinMap PinMap_I2C_SCL[] = {
52+
const PinMap __attribute__((weak)) PinMap_I2C_SCL[] = {
5353
#ifdef I2C0_BASE
5454
/* I2C0 */
5555
{PA1, I2C_0, 0},
@@ -71,7 +71,7 @@ const PinMap PinMap_I2C_SCL[] = {
7171
};
7272

7373
/************I2C SDA***********/
74-
const PinMap PinMap_I2C_SDA[] = {
74+
const PinMap __attribute__((weak)) PinMap_I2C_SDA[] = {
7575
#ifdef I2C0_BASE
7676
/* I2C0 */
7777
{PA0, I2C_0, 0},
@@ -93,7 +93,7 @@ const PinMap PinMap_I2C_SDA[] = {
9393
};
9494

9595
/************PWM***************/
96-
const PinMap PinMap_PWM[] = {
96+
const PinMap __attribute__((weak)) PinMap_PWM[] = {
9797
#if defined(TIMER_ROUTE_CC0PEN) || defined(TIMER_ROUTEPEN_CC0PEN)
9898
/* PWM0 */
9999
{PA8, PWM_CH0, 0},
@@ -116,7 +116,7 @@ const PinMap PinMap_PWM[] = {
116116
};
117117

118118
/*************SPI**************/
119-
const PinMap PinMap_SPI_MOSI[] = {
119+
const PinMap __attribute__((weak)) PinMap_SPI_MOSI[] = {
120120
#ifdef USART0_BASE
121121
/* USART0 */
122122
{PE10, SPI_0, 0},
@@ -138,7 +138,7 @@ const PinMap PinMap_SPI_MOSI[] = {
138138
{NC , NC , NC}
139139
};
140140

141-
const PinMap PinMap_SPI_MISO[] = {
141+
const PinMap __attribute__((weak)) PinMap_SPI_MISO[] = {
142142
#ifdef USART0_BASE
143143
/* USART0 */
144144
{PE11, SPI_0, 0},
@@ -160,7 +160,7 @@ const PinMap PinMap_SPI_MISO[] = {
160160
{NC , NC , NC}
161161
};
162162

163-
const PinMap PinMap_SPI_CLK[] = {
163+
const PinMap __attribute__((weak)) PinMap_SPI_CLK[] = {
164164
#ifdef USART0_BASE
165165
/* USART0 */
166166
{PE12, SPI_0, 0},
@@ -182,7 +182,7 @@ const PinMap PinMap_SPI_CLK[] = {
182182
{NC , NC , NC}
183183
};
184184

185-
const PinMap PinMap_SPI_CS[] = {
185+
const PinMap __attribute__((weak)) PinMap_SPI_CS[] = {
186186
#ifdef USART0_BASE
187187
/* USART0 */
188188
{PE13, SPI_0, 0},
@@ -205,7 +205,7 @@ const PinMap PinMap_SPI_CS[] = {
205205
};
206206

207207
/************UART**************/
208-
const PinMap PinMap_UART_TX[] = {
208+
const PinMap __attribute__((weak)) PinMap_UART_TX[] = {
209209
#ifdef UART0_BASE
210210
/* UART0 */
211211
{PF6, UART_0, 0},
@@ -253,7 +253,7 @@ const PinMap PinMap_UART_TX[] = {
253253
{NC , NC , NC}
254254
};
255255

256-
const PinMap PinMap_UART_RX[] = {
256+
const PinMap __attribute__((weak)) PinMap_UART_RX[] = {
257257
#ifdef UART0_BASE
258258
/* UART0 */
259259
{PF7, UART_0, 0},

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG/PeripheralPins.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
/************ADC***************/
2727
/* The third "function" value is used to select the correct ADC channel */
28-
const PinMap PinMap_ADC[] = {
28+
const PinMap __attribute__((weak)) PinMap_ADC[] = {
2929
#ifdef ADC0_BASE
3030
{PA0, ADC_0, adcPosSelAPORT3XCH8},
3131
{PA1, ADC_0, adcPosSelAPORT4XCH9},
@@ -67,7 +67,7 @@ const PinMap PinMap_ADC[] = {
6767
};
6868

6969
/************I2C SCL***********/
70-
const PinMap PinMap_I2C_SCL[] = {
70+
const PinMap __attribute__((weak)) PinMap_I2C_SCL[] = {
7171
#ifdef I2C0_BASE
7272
/* I2C0 */
7373
{PA1, I2C_0, 0},
@@ -107,7 +107,7 @@ const PinMap PinMap_I2C_SCL[] = {
107107
};
108108

109109
/************I2C SDA***********/
110-
const PinMap PinMap_I2C_SDA[] = {
110+
const PinMap __attribute__((weak)) PinMap_I2C_SDA[] = {
111111
#ifdef I2C0_BASE
112112
/* I2C0 */
113113
{PA0, I2C_0, 0},
@@ -148,7 +148,7 @@ const PinMap PinMap_I2C_SDA[] = {
148148
};
149149

150150
/************PWM***************/
151-
const PinMap PinMap_PWM[] = {
151+
const PinMap __attribute__((weak)) PinMap_PWM[] = {
152152
#if defined(TIMER_ROUTE_CC0PEN) || defined(TIMER_ROUTEPEN_CC0PEN)
153153
/* PWM0 */
154154
{PA0, PWM_CH0, 0},
@@ -197,7 +197,7 @@ const PinMap PinMap_PWM[] = {
197197
};
198198

199199
/*************SPI**************/
200-
const PinMap PinMap_SPI_MOSI[] = {
200+
const PinMap __attribute__((weak)) PinMap_SPI_MOSI[] = {
201201
#ifdef USART0_BASE
202202
/* USART0 */
203203
{PA0, SPI_0, 0},
@@ -239,7 +239,7 @@ const PinMap PinMap_SPI_MOSI[] = {
239239
{NC , NC , NC}
240240
};
241241

242-
const PinMap PinMap_SPI_MISO[] = {
242+
const PinMap __attribute__((weak)) PinMap_SPI_MISO[] = {
243243
#ifdef USART0_BASE
244244
/* USART0 */
245245
{PA0, SPI_0, 31},
@@ -282,7 +282,7 @@ const PinMap PinMap_SPI_MISO[] = {
282282
{NC , NC , NC}
283283
};
284284

285-
const PinMap PinMap_SPI_CLK[] = {
285+
const PinMap __attribute__((weak)) PinMap_SPI_CLK[] = {
286286
#ifdef USART0_BASE
287287
/* USART0 */
288288
{PA0, SPI_0, 30},
@@ -326,7 +326,7 @@ const PinMap PinMap_SPI_CLK[] = {
326326
{NC , NC , NC}
327327
};
328328

329-
const PinMap PinMap_SPI_CS[] = {
329+
const PinMap __attribute__((weak)) PinMap_SPI_CS[] = {
330330
#ifdef USART0_BASE
331331
/* USART0 */
332332
{PA0, SPI_0, 29},
@@ -369,7 +369,7 @@ const PinMap PinMap_SPI_CS[] = {
369369
};
370370

371371
/************UART**************/
372-
const PinMap PinMap_UART_TX[] = {
372+
const PinMap __attribute__((weak)) PinMap_UART_TX[] = {
373373
#ifdef USART0_BASE
374374
/* USART0 */
375375
{PA0, USART_0, 0},
@@ -414,7 +414,7 @@ const PinMap PinMap_UART_TX[] = {
414414
{NC , NC , NC}
415415
};
416416

417-
const PinMap PinMap_UART_RX[] = {
417+
const PinMap __attribute__((weak)) PinMap_UART_RX[] = {
418418
#ifdef USART0_BASE
419419
/* USART0 */
420420
{PA0, USART_0, 31},

0 commit comments

Comments
 (0)