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 2007 Threads] Calling a funtion from two tasksPosted by Nobody/Anonymous on February 1, 2007 i am working on luminary micro kit LM-EV3S811. I am using FreeRtos for my application. I have used a display funtion which prints on screen. But should I make sure that only one task can call the function at a time. If do dont make any provision to restrict the calling of function by one task (by a semaphore) will 1)the program hang 2)will display a mix message 3)any other
RE: Calling a funtion from two tasksPosted by Nobody/Anonymous on February 1, 2007 You have to serialize access to the display just like any other resource in your system.
Take a look at FreeRTOS\Demo\CORTEX_LM3S811_KEIL\main.c - it shows you one way of doing what you want on the same hardware you are using. The task vPrintTask() is the only task that accesses the LCD. Other tasks that want to print things to the LCD send their text to vPrintTask() and do not write to the LCD directly. The comments at the top of the file explain it further.
The alternative method would be to use a semaphore to provide mutual exclusion to the LCD but this would not be recommended as writing messages to the LCD is a lengthy process and you would potentially get into problems with priority inversion.
Dave.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|