summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-22 16:09:10 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-22 16:09:10 +0000
commit4c97f71507ad55c05dde7979f450dfa4d9c7d800 (patch)
tree4a123dae59fba7a45afa0683bedf9022cd3c6f89 /nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
parentf538392b3b9cb194d8b33b14b9a8e17636cf7f81 (diff)
downloadpx4-nuttx-4c97f71507ad55c05dde7979f450dfa4d9c7d800.tar.gz
px4-nuttx-4c97f71507ad55c05dde7979f450dfa4d9c7d800.tar.bz2
px4-nuttx-4c97f71507ad55c05dde7979f450dfa4d9c7d800.zip
Use of BASEPRI to control ARM interrupts is now functional
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5548 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c')
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
index bf6d18287..0241d4bf7 100644
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
@@ -104,11 +104,28 @@
#endif
/* If the user did not specify a priority for Ethernet interrupts, set the
- * interrupt priority to the maximum.
+ * interrupt priority to the maximum (unless CONFIG_ARMV7M_USEBASEPRI is
+ * defined, then set it to the maximum allowable priority).
*/
#ifndef CONFIG_NET_PRIORITY
-# define CONFIG_NET_PRIORITY NVIC_SYSH_PRIORITY_MAX
+# 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
#endif
/* Debug Configuration *****************************************************/