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] [February 2015 Threads]
Hi all,
1- What's the difference between taskEnterCritical, portEnterCritical and portDISABLE_INTERRUPTS API functions?
2- Suppose i have the following Task and IRQ handler in my running program:
IRQHandler /* Priority supposed to be above MAXSYSCALLINTERRUPTPRIORITY */
{
...
flag = TRUE;
}
TaskA
{
bool mysecflag = FALSE;
portDISABLEINTERRUPTS(); /* Whitch API should i use? portDISABLE, taskENTERCRITICAL? */
mysecflag = flag;
portENABLE_INTERRUPTS();
if (mysecflag == TRUE)
{
mysecflag = FALSE
}
}
3- Does freertos mask some interrupts priority level in a Cortex M0+? or it enables and disables global interrupts?
Thanks in advance
}
1- What's the difference between taskEnterCritical, portEnterCritical
taskENTERCRITICAL() is a macro that calls portENTERCRITICAL() - the idea being that things that start 'task' are part of the API and things that call 'port' are not meant to be public functions. There is nothing to stop you calling the 'port' version - it will do exactly the same thing. Also the naming convention falls down a bit when it comes to macros like portYIELDFROMISR(), for which there is no 'task' equivalent.
and portDISABLE_INTERRUPTS API functions?
That is not part of the public API and should not really be called. It does not handle nesting so can break the nesting if any exists.
The M0+ does not have a basepri register like the Cortex-M3/4/7 so global interrupt enable/disable is used.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.