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] [November 2012 Threads] Nonblocking mutex take from ISRPosted by Kevin on November 14, 2012 I understand that ISRs cannot block waiting on mutexes. However, I would like to take a mutex in an ISR only if it is available, and not otherwise. This is equivalent to pthread_mutex_trylock in posix threads. Is it safe to call xSemaphoreTake with a timeout of 0 from an ISR in all cases? I'm not sure why this wouldn't work, but the API reference says it doesn't. Is there another way to handle this? Or is this operation unsupported by FreeRTOS?
Thank you, Kevin
RE: Nonblocking mutex take from ISRPosted by MEdwards on November 14, 2012 FreeRTOS V7.2.0 (it is not on 7.3.0) added an xSemaphoreTakeFromISR() function. Use with caution on a mutex type sempahore as I don't know the implications on priority inheritance. It might be ok, I don't know. Richard?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|