From df87d1a9e9e3e3db4ba143ac35c231198c4ed053 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 24 Sep 2008 13:08:28 +0000 Subject: [PATCH] Change to use interrupt priority definitions that use shifted values from 0 to 7, rather than the full numeric value. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@485 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/FreeRTOSConfig.h | 6 +++--- Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/IntQueueTimer.c | 2 +- Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/FreeRTOSConfig.h b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/FreeRTOSConfig.h index 88f6a9e5c..cc7d52995 100644 --- a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/FreeRTOSConfig.h +++ b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/FreeRTOSConfig.h @@ -67,7 +67,7 @@ #define configUSE_TICK_HOOK 1 #define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 50000000 ) #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 60 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 80 ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24000 ) ) #define configMAX_TASK_NAME_LEN ( 12 ) #define configUSE_TRACE_FACILITY 1 @@ -96,8 +96,8 @@ to exclude the API function. */ -#define configKERNEL_INTERRUPT_PRIORITY 255 -#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xa0, or priority 5. */ +#define configKERNEL_INTERRUPT_PRIORITY ( ( unsigned portCHAR ) 7 << ( unsigned portCHAR ) 5 ) /* Priority 7, or 255 as only the top three bits are implemented. This is the lowest priority. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( ( unsigned portCHAR ) 5 << ( unsigned portCHAR ) 5 ) /* Priority 5, or 160 as only the top three bits are implemented. */ #endif /* FREERTOS_CONFIG_H */ diff --git a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/IntQueueTimer.c b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/IntQueueTimer.c index 92392a6b5..bd6e6e050 100644 --- a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/IntQueueTimer.c +++ b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/IntQueueTimer.c @@ -77,7 +77,7 @@ unsigned long ulFrequency; /* Set the timer interrupts to be above the kernel. The interrupts are assigned different priorities so they nest with each other. */ - IntPrioritySet( INT_TIMER2A, configMAX_SYSCALL_INTERRUPT_PRIORITY - 1 ); + IntPrioritySet( INT_TIMER2A, configMAX_SYSCALL_INTERRUPT_PRIORITY + ( 1 << 5 ) ); /* Shift left 5 as only the top 3 bits are implemented. */ IntPrioritySet( INT_TIMER3A, configMAX_SYSCALL_INTERRUPT_PRIORITY ); /* Ensure interrupts do not start until the scheduler is running. */ diff --git a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c index 8e2092ce6..cd61b06ea 100644 --- a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c +++ b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c @@ -261,6 +261,7 @@ int main( void ) /* Will only get here if there was insufficient memory to create the idle task. */ + for( ;; ); return 0; } /*-----------------------------------------------------------*/ -- 2.39.5