FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2012 Threads]
Here is an example I just lifted from the new Atmel demo (I didn't choose the macro names!)
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY10
This defines configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY to be in a form acceptable to the NVIC_SetPriority function.
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
This uses the configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY definition to set configMAX_SYSCALL_INTERRUPT_PRIORITY in a form acceptable to the NVIC directly (which is how the FreeRTOS port layer uses it internally).
In this example, an interrupt that uses the FreeRTOS API has to have its priority set using the NVIC_SetPriority() function to a value of 10 or higher (so 10, 11, 12, etc).
(I also didn't design the Cortex-M3 NVIC mash up!)
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.