The two tasks created in the previous example are almost identical, the only difference between them being the text string they print out. This duplication can be removed by, instead, creating two instances of a single task implementation. The task parameter should be used to pass into each task the string that it should print out.
► Launch Code Composer Studio
► Import atomthreads Template Project into the current workspace
►Rename the Project as atomthreads_threads_assignment_two
►Launch Serial terminal emulator (minicom, gtkterm,etc) and configure for 115200,8,1,N
►Write a single thread function (Thread_Function). The thread parameter should be used to obtain the string the task should print out.
The entry_param parameter of the atomThreadCreate() function is used to pass parameter into the task
- Even though there is now only one task implementation (Thread_Function), more than one instance of the defined task can be created.
- Each created instance will execute independently under the control of the atomthreads scheduler.
Recent Comments