X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm32f4%2Fao_arch_funcs.h;h=8ff31b4a917620865d3c368b1756cb934edaf1b5;hb=338372b97d441c30d2a23df540163a66a7f8d8c0;hp=8c0da03bf37b402bc39826a946b712b2f62942c1;hpb=2cdb1f30c49ba460b0850d23ba9c85e0336af290;p=fw%2Faltos diff --git a/src/stm32f4/ao_arch_funcs.h b/src/stm32f4/ao_arch_funcs.h index 8c0da03b..8ff31b4a 100644 --- a/src/stm32f4/ao_arch_funcs.h +++ b/src/stm32f4/ao_arch_funcs.h @@ -84,7 +84,7 @@ ao_arch_irq_check(void) { static inline void ao_arch_init_stack(struct ao_task *task, void *start) { - uint32_t *sp = (uint32_t *) ((void*) task->stack + AO_STACK_SIZE); + uint32_t *sp = &task->stack32[AO_STACK_SIZE>>2]; uint32_t a = (uint32_t) start; int i; @@ -110,7 +110,7 @@ ao_arch_init_stack(struct ao_task *task, void *start) /* BASEPRI with interrupts enabled */ ARM_PUSH32(sp, 0); - task->sp = sp; + task->sp32 = sp; } static inline void ao_arch_save_regs(void) { @@ -142,12 +142,12 @@ static inline void ao_arch_save_regs(void) { static inline void ao_arch_save_stack(void) { uint32_t *sp; asm("mov %0,sp" : "=&r" (sp) ); - ao_cur_task->sp = (sp); + ao_cur_task->sp32 = (sp); } static inline void ao_arch_restore_stack(void) { /* Switch stacks */ - asm("mov sp, %0" : : "r" (ao_cur_task->sp) ); + asm("mov sp, %0" : : "r" (ao_cur_task->sp32) ); #ifdef AO_NONMASK_INTERRUPTS /* Restore BASEPRI */ @@ -331,4 +331,10 @@ static inline void ao_disable_port(struct stm_gpio *port) ao_gpio_set_mode(port, bit, mode); \ } while (0) +/* usart */ + +void +ao_usart_init(void); + + #endif /* _AO_ARCH_FUNCS_H_ */