From 6a3a766b005f53f78491b24422bfb2417875c366 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 19 Apr 2014 07:56:59 -0600 Subject: [PATCH] LPC17xx: Prioritized interrupts are not supported (although hooks are present to prioritize interrupts). Make LPC17 Ethernet default priority to be the system default, not the highest. If the unsupported feature is enabled, then at least it should do no harm --- ChangeLog | 2 ++ arch/arm/src/lpc17xx/Kconfig | 5 +++-- arch/arm/src/lpc17xx/lpc17_ethernet.c | 25 ++++--------------------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5adf931df54..bc54bc6986f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7207,3 +7207,5 @@ fixed number of initializations based a priori knowledge of the number of interrupt lines in the MCU. This logic is untested on some MCUs on initial check-in0 (2014-4-17). + * arm/src/lpc17xx/Kconfig and lpc17_ethernet.c: The default interrupt + priority should be default, not the highest priority (2014-4-19). diff --git a/arch/arm/src/lpc17xx/Kconfig b/arch/arm/src/lpc17xx/Kconfig index d1e76062d13..b876835ca78 100644 --- a/arch/arm/src/lpc17xx/Kconfig +++ b/arch/arm/src/lpc17xx/Kconfig @@ -668,9 +668,10 @@ config NET_NRXDESC config NET_PRIORITY int "Ethernet interrupt priority" - default 0 + default 128 + depends on ARCH_IRQPRIO && EXPERIMENTAL ---help--- - Ethernet interrupt priority. The is default is the higest priority (0). + Ethernet interrupt priority. The default is the default priority (128). config NET_WOL bool "Wake-up on LAN" diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index 2b7c157a0bb..360b6acc927 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc17xx/lpc17_ethernet.c * - * Copyright (C) 2010-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -72,7 +72,7 @@ #if LPC17_NETHCONTROLLERS > 0 /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ @@ -104,28 +104,11 @@ #endif /* If the user did not specify a priority for Ethernet interrupts, set the - * interrupt priority to the maximum (unless CONFIG_ARMV7M_USEBASEPRI is - * defined, then set it to the maximum allowable priority). + * interrupt priority to the default. */ #ifndef CONFIG_NET_PRIORITY -# ifdef CONFIG_ARMV7M_USEBASEPRI -# define CONFIG_NET_PRIORITY NVIC_SYSH_DISABLE_PRIORITY -# else -# define CONFIG_NET_PRIORITY NVIC_SYSH_PRIORITY_MAX -# endif -#endif - -/* If the priority is set at the max (0) and CONFIG_ARMV7M_USEBASEPRI is - * defined, then silently drop the priority to NVIC_SYSH_DISABLE_PRIORITY. - * In this configuratin, nothing is permitted to run at priority zero - * except for the SVCALL handler. NVIC_SYSH_DISABLE_PRIORITY is the - * maximum allowable priority in that case. - */ - -#if CONFIG_NET_PRIORITY == 0 && defined(CONFIG_ARMV7M_USEBASEPRI) -# undef CONFIG_NET_PRIORITY -# define CONFIG_NET_PRIORITY NVIC_SYSH_DISABLE_PRIORITY +# define CONFIG_NET_PRIORITY NVIC_SYSH_PRIORITY_DEFAULT #endif /* Debug Configuration *****************************************************/