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] [June 2009 Threads] FreeRTOS support multi-level of interrupt?Posted by newnie super on June 17, 2009 I'm porting FreeRTOS to my application. It seems that FreeRTOS protects the critical section simply by disabling the global interrupt and reenabling the global interrupt when exit from critical section. The problem is, my application may have disabled the global interupt before calling protection function, such as EnterCritical, which means when exit from the critical section the global interrupt will be enabled but my application doesn't want to. Any help would be greatly appreciated. Thanks.
RE: FreeRTOS support multi-level of interrupt?Posted by Richard Damon on June 17, 2009 The simple solution is for you to use the EnterCritical/ExitCritical functions to disable/enable interrupts in your own code.
You should be a bit careful with this, as some ports of freeRTOS do not disable ALL the interrupts in critical sections, but only those below the level that are allowed to access the kernel, so if you need others disabled you should do it in a way that you can easily fix for when (or if) that feature makes it to the port you are using.
RE: FreeRTOS support multi-level of interrupt?Posted by newnie super on June 17, 2009 Many thanks for your reply but you might be misunderstanding my question.
To sum up, my code needs to recover the interrupt status after ExitCritical called, i.e., if the interrupt has been disabled before EnterCritical is called, then the interrupt status should still keep disabled even ExitCritical called after.
Thanks again.
RE: FreeRTOS support multi-level of interrupt?Posted by Richard Damon on June 17, 2009 The way to do that is to use EnterCritical as the way to disable your interrupts. That way FreeRTOS can manage the interrupts.
The other option is to change EnterCritical/ExitCritical to somehow save the interrupt state (or at least what the interrupt state was when the first level of EnterCritical was called), and have this restored by ExitCritical. Note that this will add overhead to all Critical Setions, so the first method (using calls to EnterCritical) is preferred.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|