summaryrefslogtreecommitdiffstatshomepage
path: root/teensy/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'teensy/main.c')
-rw-r--r--teensy/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/teensy/main.c b/teensy/main.c
index 3b2994c86f..bc687fa675 100644
--- a/teensy/main.c
+++ b/teensy/main.c
@@ -253,9 +253,13 @@ char *strdup(const char *str) {
#endif
int main(void) {
- pinMode(LED_BUILTIN, OUTPUT);
- delay(1000);
+ // TODO: Put this in a more common initialization function.
+ // Turn on STKALIGN which keeps the stack 8-byte aligned for interrupts
+ // (per EABI)
+ #define SCB_CCR_STKALIGN (1 << 9)
+ SCB_CCR |= SCB_CCR_STKALIGN;
+ pinMode(LED_BUILTIN, OUTPUT);
led_init();
// int first_soft_reset = true;