From 0fc6a3c02466b43235968de6e3c4d4fca071f0a3 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Mon, 7 Oct 2013 16:49:31 +0000 Subject: [PATCH] Make corrections to the interrupt priority configuration in the LPC1800 UDP demo that resulted from an incorrect NVIC_PRIOR_BITS setting in the LPC18xx.h header file. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2052 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../CreateProjectDirectoryStructure.bat | 1 - .../FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h | 6 ++---- .../ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h | 2 +- .../ThirdParty/USB_CDC/usbhw.c | 4 ++-- .../cr_startup_lpc18xx.c | 1 - 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CreateProjectDirectoryStructure.bat b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CreateProjectDirectoryStructure.bat index 1d6334568..e60a79eb8 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CreateProjectDirectoryStructure.bat +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CreateProjectDirectoryStructure.bat @@ -51,7 +51,6 @@ IF EXIST FreeRTOS_Source Goto END REM Copy the FreeRTOS+UDP core files copy %FREERTOS_UDP_SOURCE%\*.c FreeRTOS_Plus_UDP - copy %FREERTOS_UDP_SOURCE%\include\*.h FreeRTOS_Plus_UDP copy %FREERTOS_UDP_SOURCE%\readme.txt FreeRTOS_Plus_UDP copy %FREERTOS_UDP_SOURCE%\include\*.* FreeRTOS_Plus_UDP\include diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h index bf789f969..eaf23aad8 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h @@ -155,7 +155,7 @@ is one */ #ifdef __NVIC_PRIO_BITS #define configPRIO_BITS __NVIC_PRIO_BITS #else - #define configPRIO_BITS 5 /* 32 priority levels */ + #define configPRIO_BITS 3 /* 8 priority levels */ #endif /* The maximum priority an interrupt that uses an interrupt safe FreeRTOS API @@ -163,7 +163,7 @@ function can have. Note that lower priority have numerically higher values. */ #define configMAX_LIBRARY_INTERRUPT_PRIORITY ( 5 ) /* The minimum possible interrupt priority. */ -#define configMIN_LIBRARY_INTERRUPT_PRIORITY ( 31 ) +#define configMIN_LIBRARY_INTERRUPT_PRIORITY ( 7 ) /* The lowest priority. */ #define configKERNEL_INTERRUPT_PRIORITY ( configMIN_LIBRARY_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) @@ -178,8 +178,6 @@ standard names. */ #define xPortSysTickHandler SysTick_Handler - - /* * DEMO APPLICATION SPECIFIC DEFINITIONS FOLLOW FROM HERE */ diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h index 9241fba30..32fbff3b5 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h @@ -158,7 +158,7 @@ typedef enum { #define __CM3_REV 0x0101 /*!< Cortex-M3 Core Revision */ #define __MPU_PRESENT 1 /*!< MPU present or not */ -#define __NVIC_PRIO_BITS 4 /*!< Number of Bits used for Priority Levels */ +#define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */ #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ /** @} */ /* End of group Configuration_of_CMSIS */ diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbhw.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbhw.c index a49596f8e..01c222d67 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbhw.c +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbhw.c @@ -132,10 +132,10 @@ void USB_Init (LPC_USBDRV_INIT_T* cbs) #ifdef USE_USB0 NVIC_EnableIRQ(USB0_IRQn); // enable USB0 interrrupts - NVIC_SetPriority(USB0_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY ); + NVIC_SetPriority(USB0_IRQn, configMIN_LIBRARY_INTERRUPT_PRIORITY ); #else NVIC_EnableIRQ(USB1_IRQn); // enable USB1 interrrupts - NVIC_SetPriority(USB0_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY ); + NVIC_SetPriority(USB0_IRQn, configMIN_LIBRARY_INTERRUPT_PRIORITY ); #endif USB_Reset(); diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/cr_startup_lpc18xx.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/cr_startup_lpc18xx.c index c9d8e9d17..13853fc1d 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/cr_startup_lpc18xx.c +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/cr_startup_lpc18xx.c @@ -413,7 +413,6 @@ void NMI_Handler(void) __attribute__ ((section(".after_vectors"))) void HardFault_Handler(void) { -return; __asm volatile ( " tst lr, #4 \n" -- 2.39.5