aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/main.cpp')
-rwxr-xr-xcores/arduino/main.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp
index cc6e81d..0ef5256 100755
--- a/cores/arduino/main.cpp
+++ b/cores/arduino/main.cpp
@@ -1,13 +1,20 @@
-#include <WProgram.h>
+#define ARDUINO_MAIN
+#include <Arduino.h>
int main(void)
{
init();
+#if defined(USBCON)
+ USB.attach();
+#endif
+
setup();
- for (;;)
+ for (;;) {
loop();
+ if (serialEventRun) serialEventRun();
+ }
return 0;
}