Skip to content

Commit 92efd74

Browse files
committed
Add missing forward declaration of PINCOUNT_fn()
1 parent 9325370 commit 92efd74

File tree

14 files changed

+50
-2
lines changed

14 files changed

+50
-2
lines changed

variants/arduino_mzero/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ extern "C"
5353
*----------------------------------------------------------------------------*/
5454

5555
// Number of pins defined in PinDescription array
56+
#ifdef __cplusplus
57+
extern "C" unsigned int PINCOUNT_fn();
58+
#endif
5659
#define PINS_COUNT (PINCOUNT_fn())
5760
#define NUM_DIGITAL_PINS (19u)
5861
#define NUM_ANALOG_INPUTS (5u)

variants/arduino_zero/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ extern "C"
5353
*----------------------------------------------------------------------------*/
5454

5555
// Number of pins defined in PinDescription array
56+
#ifdef __cplusplus
57+
extern "C" unsigned int PINCOUNT_fn();
58+
#endif
5659
#define PINS_COUNT (PINCOUNT_fn())
5760
#define NUM_DIGITAL_PINS (20u)
5861
#define NUM_ANALOG_INPUTS (6u)

variants/circuitplay/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
// ----
3838

3939
// Number of pins defined in PinDescription array
40+
#ifdef __cplusplus
41+
extern "C" unsigned int PINCOUNT_fn();
42+
#endif
4043
#define PINS_COUNT (PINCOUNT_fn())
4144
#define NUM_DIGITAL_PINS (39u)
4245
#define NUM_ANALOG_INPUTS (11u)

variants/mkr1000/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
3942
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (22u)
4144
#define NUM_ANALOG_INPUTS (7u)

variants/mkrfox1200/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
3942
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (15u)
4144
#define NUM_ANALOG_INPUTS (7u)

variants/mkrgsm1400/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
3942
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (15u)
4144
#define NUM_ANALOG_INPUTS (7u)

variants/mkrnb1500/variant.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ const PinDescription g_APinDescription[] = {
163163

164164
const void* g_apTCInstances[TCC_INST_NUM + TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 };
165165

166+
extern "C" {
167+
unsigned int PINCOUNT_fn() {
168+
return (sizeof(g_APinDescription) / sizeof(g_APinDescription[0]));
169+
}
170+
}
171+
166172
// Multi-serial objects instantiation
167173
SERCOM sercom0(SERCOM0);
168174
SERCOM sercom1(SERCOM1);

variants/mkrnb1500/variant.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39-
#define PINS_COUNT (26u)
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
42+
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (15u)
4144
#define NUM_ANALOG_INPUTS (7u)
4245
#define NUM_ANALOG_OUTPUTS (1u)

variants/mkrvidor4000/variant.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ const PinDescription g_APinDescription[] = {
162162

163163
const void* g_apTCInstances[TCC_INST_NUM + TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 };
164164

165+
extern "C" {
166+
unsigned int PINCOUNT_fn() {
167+
return (sizeof(g_APinDescription) / sizeof(g_APinDescription[0]));
168+
}
169+
}
170+
165171
#if defined(USE_BQ24195L_PMIC)
166172

167173
#include "wiring_private.h"

variants/mkrvidor4000/variant.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39-
#define PINS_COUNT (35u)
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
42+
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (15u)
4144
#define NUM_ANALOG_INPUTS (7u)
4245
#define NUM_ANALOG_OUTPUTS (1u)

variants/mkrwan1300/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
3942
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (15u)
4144
#define NUM_ANALOG_INPUTS (7u)

variants/mkrwifi1010/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
3942
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (15u)
4144
#define NUM_ANALOG_INPUTS (7u)

variants/mkrzero/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
// ----
3737

3838
// Number of pins defined in PinDescription array
39+
#ifdef __cplusplus
40+
extern "C" unsigned int PINCOUNT_fn();
41+
#endif
3942
#define PINS_COUNT (PINCOUNT_fn())
4043
#define NUM_DIGITAL_PINS (15u)
4144
#define NUM_ANALOG_INPUTS (7u)

variants/nano_33_iot/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
// ----
3838

3939
// Number of pins defined in PinDescription array
40+
#ifdef __cplusplus
41+
extern "C" unsigned int PINCOUNT_fn();
42+
#endif
4043
#define PINS_COUNT (PINCOUNT_fn())
4144
#define NUM_DIGITAL_PINS (31u)
4245
#define NUM_ANALOG_INPUTS (8u)

0 commit comments

Comments
 (0)