Quality RTOS & Embedded Software

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


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 ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists