aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/main.cpp')
-rw-r--r--cores/arduino/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp
index 0ad6962..72074de 100644
--- a/cores/arduino/main.cpp
+++ b/cores/arduino/main.cpp
@@ -19,10 +19,20 @@
#include <Arduino.h>
+// Declared weak in Arduino.h to allow user redefinitions.
+int atexit(void (* /*func*/ )()) { return 0; }
+
+// Weak empty variant initialization function.
+// May be redefined by variant files.
+void initVariant() __attribute__((weak));
+void initVariant() { }
+
int main(void)
{
init();
+ initVariant();
+
#if defined(USBCON)
USBDevice.attach();
#endif