summaryrefslogtreecommitdiffstatshomepage
path: root/teensy
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-29 12:22:53 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-29 12:22:53 +0100
commit6e2051377f89a90b2c22bc49f471f85c595b6f8e (patch)
tree986d13d32ab6508c675af1ff53d2dc596d8472cf /teensy
parent305c4d49be69a756eacfd2480266b5a1e5052e15 (diff)
parentada691e704c0c8dcf4cb1aaeba5d76c02e89f03b (diff)
downloadmicropython-6e2051377f89a90b2c22bc49f471f85c595b6f8e.tar.gz
micropython-6e2051377f89a90b2c22bc49f471f85c595b6f8e.zip
Merge pull request #880 from dhylands/irq-align
teensy: Enable 8-byte stack alignment for IRQ Handlers.
Diffstat (limited to 'teensy')
-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;