aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/main.cpp')
-rwxr-xr-xcores/arduino/main.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp
index 3c46f1e..34450f4 100755
--- a/cores/arduino/main.cpp
+++ b/cores/arduino/main.cpp
@@ -1,14 +1,19 @@
-#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;
}