diff --git a/src/scheduler.c b/src/scheduler.c index 697df63ee1..503639fa81 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -84,15 +84,12 @@ static void _rt_scheduler_stack_check(struct rt_thread *thread) #if defined(ARCH_CPU_STACK_GROWS_UPWARD) if (*((rt_uint8_t *)((rt_ubase_t)thread->stack_addr + thread->stack_size - 1)) != '#' || - (rt_ubase_t)thread->sp <= (rt_ubase_t)thread->stack_addr || - (rt_ubase_t)thread->sp > - (rt_ubase_t)thread->stack_addr + (rt_ubase_t)thread->stack_size) #else if (*((rt_uint8_t *)thread->stack_addr) != '#' || +#endif (rt_ubase_t)thread->sp <= (rt_ubase_t)thread->stack_addr || (rt_ubase_t)thread->sp > (rt_ubase_t)thread->stack_addr + (rt_ubase_t)thread->stack_size) -#endif { rt_ubase_t level;