aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/main.cpp
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2014-07-01 17:28:45 +0200
committerCristian Maglie <c.maglie@bug.st>2014-07-01 17:28:45 +0200
commit452cab0593ba0fcca89f56d57de6cee67bce78ac (patch)
tree506fec5846f97dfe5ef4c4f242bcb234b41687ba /cores/arduino/main.cpp
parent07ef56e3cbd6ffc9b083e84777d2ec4186514202 (diff)
parentb4fc466b47e9d69f3d189987dcf0750713afff1a (diff)
Merge pull request #2139 from cmaglie/init-variant
Allow variants to define an initVariant() function that is called at startup
Diffstat (limited to 'cores/arduino/main.cpp')
-rw-r--r--cores/arduino/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp
index 0ad6962..091c365 100644
--- a/cores/arduino/main.cpp
+++ b/cores/arduino/main.cpp
@@ -19,10 +19,17 @@
#include <Arduino.h>
+// 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