Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Calling a funtion from two tasks

Posted 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 tasks

Posted 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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner