Quality RTOS & Embedded Software

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


Loading

Best way to block a task?

Posted by raedbenz on December 7, 2009
HI,,
I need to run a task after acertain event occurs (e.g. button push)..
so what is more efficient with the minimum cpu overheads and more reliable, to use **vTaskSuspend** from the first call to of the task, or a semaphore with max delay. ?
thanks

RE: Best way to block a task?

Posted by Dave on December 7, 2009
Use a binary or counting semaphore with max delay. If you set INCLUDE_vTaskSuspend to 1 in FreeRTOSConfig.h then max delay will be an indefinite delay.

Do not use vTaskSuspend() for event processing. It does not latch events so it is easy to miss them.


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


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

Careers

FreeRTOS and other embedded software careers at AWS.


Latest News

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


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