Quality RTOS & Embedded Software

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




Loading

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.

Dave.


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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