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 2014 Threads]
Hi,
I am trying to implement FreeRTOS on controller with specific API calls. In the bare controller example, there are a few commands which are used at the beginning and end of while(1) loop in main as follows:
void main (void)
{
...
while(1)
command1();
/*
your application code here
*/
command2();
}
It is mandatory to used command1 and command2. Where in FreeRTOS should I write calls to command1 and command2 functions?
}
I'm not sure I understand your question. Let me state it back to see if I have it right.
Currently you have a non-RTOS application that is structured as follows:
while( 1 )
{
/* Must be called before application code. */
command1();
/* Application code goes here. */
/* Must be called after application code. */
command2();
}
now you want to implement the same thing but using the RTOS.
If so then the first thing to say is you could just create that function as a task and have it run. If it does not block and you have other tasks running it would have to be a low priority though.
Other than that any answer would depend on the what command1() and command2() were, what is their purpose, what are their processing requirements, and what relation (if any) do they have to the application code.
For example, does command2() use a value calculated by the application code, in which case it must be executed exactly once after each execution of the application code.
Or alternatively is command2() completely unrelated to the application code but needs to be called either periodically or as fast as possible.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.