From 5e19807250770b41434667af2425926487a760f1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 15:37:13 -0600 Subject: [PATCH] Correct the initial value of the BASEPRI register. This was apparently never being initialized. From Max --- arch/arm/src/armv7-m/up_initialstate.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/armv7-m/up_initialstate.c b/arch/arm/src/armv7-m/up_initialstate.c index 7b6eb30420..c60f181f10 100644 --- a/arch/arm/src/armv7-m/up_initialstate.c +++ b/arch/arm/src/armv7-m/up_initialstate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_initialstate.c * - * Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -147,10 +147,18 @@ void up_initial_state(struct tcb_s *tcb) /* Enable or disable interrupts, based on user configuration */ #ifdef CONFIG_SUPPRESS_INTERRUPTS + #ifdef CONFIG_ARMV7M_USEBASEPRI xcp->regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; #else xcp->regs[REG_PRIMASK] = 1; #endif + +#else /* CONFIG_SUPPRESS_INTERRUPTS */ + +#ifdef CONFIG_ARMV7M_USEBASEPRI + xcp->regs[REG_BASEPRI] = NVIC_SYSH_MAXNORMAL_PRIORITY; +#endif + #endif /* CONFIG_SUPPRESS_INTERRUPTS */ }