Skip to content

Commit 0203e2d

Browse files
committed
Fix weaked initVariant()declaration
Can be defined WEAK or not in the variant and/or at sketch level. Signed-off-by: Frederic Pillon <[email protected]>
1 parent ea6e7a0 commit 0203e2d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Diff for: cores/arduino/Arduino.h

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#ifdef __cplusplus
4141
extern "C" {
4242
#endif // __cplusplus
43+
// Weak empty variant initialization function.
44+
// May be redefined by variant files.
45+
extern void initVariant() __attribute__((weak));
46+
4347
extern void setup(void) ;
4448
extern void loop(void) ;
4549

Diff for: cores/arduino/main.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
#define ARDUINO_MAIN
2121
#include "Arduino.h"
2222

23-
24-
// Weak empty variant initialization function.
25-
// May be redefined by variant files.
26-
void initVariant() __attribute__((weak));
27-
void initVariant() { }
28-
2923
// Force init to be called *first*, i.e. before static object allocation.
3024
// Otherwise, statically allocated objects that need HAL may fail.
3125
__attribute__((constructor(101))) void premain()

0 commit comments

Comments
 (0)