-
Notifications
You must be signed in to change notification settings - Fork 0
/
teensy3-debug-startup.diff
46 lines (40 loc) · 1012 Bytes
/
teensy3-debug-startup.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Only in teensy3.orig: .mk20dx128.c.swp
diff -ur teensy3.orig/mk20dx128.c teensy3/mk20dx128.c
--- teensy3.orig/mk20dx128.c 2014-10-27 22:14:43.000000000 -0700
+++ teensy3/mk20dx128.c 2014-10-31 15:20:01.000000000 -0700
@@ -565,13 +565,22 @@
__enable_irq();
_init_Teensyduino_internal_();
+
if (RTC_SR & RTC_SR_TIF) {
// TODO: this should probably set the time more agressively, if
// we could reliably detect the first reboot after programming.
rtc_set(TIME_T);
}
+#if 1
__libc_init_array();
+#endif
+
+#if 0
+ digitalWrite(13, 1);
+ delay(150);
+ digitalWrite(13, 0);
+#endif
startup_late_hook();
main();
diff -ur teensy3.orig/pins_teensy.c teensy3/pins_teensy.c
--- teensy3.orig/pins_teensy.c 2014-10-31 15:07:45.000000000 -0700
+++ teensy3/pins_teensy.c 2014-10-31 15:12:36.000000000 -0700
@@ -395,7 +395,15 @@
#endif
delay(4);
+ pinMode(13, OUTPUT);
+ digitalWrite(13, HIGH);
+ delay(150);
+ digitalWrite(13, LOW);
+ delay(150);
+
usb_init();
+
+ delay(500);
}