altos/stm32f4: Align stack to 8 bytes
authorKeith Packard <keithp@keithp.com>
Wed, 12 Sep 2018 01:46:52 +0000 (18:46 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 13 Oct 2018 15:23:25 +0000 (08:23 -0700)
This makes sure that doubles are aligned properly when passed on the stack.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_task.h
src/stm32f4/ao_arch.h

index f3789fa..709e10c 100644 (file)
 #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 */
index 73eb793..d4c78f6 100644 (file)
 #include <stm32f4.h>
 
 #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")