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 2008 Threads] Task local variablesPosted by Peter Nielsen on November 24, 2008 Hi
My question: if i use a lot of local variables in a taskA - i.e. some of them are in CPU registers and some are put on the stack (thats how memory normally are allocated).
Now a higher priority taskB preemtives taskA and do some job and returns control to taskA.
When taskA runs again are all local variables valid or do i have to declare them static - i asume them in Cpu regs. are restored but what about the local vars. which where stored on the stack in taskA ???????
RE: Task local variablesPosted by Jesper Matthiesen on November 24, 2008 yes, all registers are saved on the stack before a context switch and restored afterwards, so your vars will be intact..
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|