From 23075d174d2bff8ff3f3deef3c3d90b83da6bd2e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2018 18:46:52 -0700 Subject: [PATCH] altos/stm32f4: Align stack to 8 bytes This makes sure that doubles are aligned properly when passed on the stack. Signed-off-by: Keith Packard --- src/kernel/ao_task.h | 6 ++---- src/stm32f4/ao_arch.h | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kernel/ao_task.h b/src/kernel/ao_task.h index f3789fa2..709e10c6 100644 --- a/src/kernel/ao_task.h +++ b/src/kernel/ao_task.h @@ -27,14 +27,12 @@ #endif /* arm stacks must be 32-bit aligned */ +#ifndef AO_STACK_ALIGNMENT #ifdef __arm__ #define AO_STACK_ALIGNMENT __attribute__ ((aligned(4))) -#endif -#ifdef SDCC +#else #define AO_STACK_ALIGNMENT #endif -#ifdef __AVR__ -#define AO_STACK_ALIGNMENT #endif /* An AltOS task */ diff --git a/src/stm32f4/ao_arch.h b/src/stm32f4/ao_arch.h index 73eb793f..d4c78f60 100644 --- a/src/stm32f4/ao_arch.h +++ b/src/stm32f4/ao_arch.h @@ -19,9 +19,11 @@ #include #ifndef AO_STACK_SIZE -#define AO_STACK_SIZE 512 +#define AO_STACK_SIZE 1024 #endif +#define AO_STACK_ALIGNMENT __attribute__ ((aligned(8))) + #define AO_PORT_TYPE uint16_t #define ao_arch_nop() asm("nop") -- 2.30.2