# take/give semaphore in vApplicationTickHook

**URL:** <https://forums.freertos.org/t/take-give-semaphore-in-vapplicationtickhook/4847>\
**Category:** Kernel\
**Created:** [May 29, 2012, 4:38pm UTC](https://forums.freertos.org/t/take-give-semaphore-in-vapplicationtickhook/4847 "2012-05-29T16:38:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 29, 2012, 4:38pm UTC](https://forums.freertos.org/t/take-give-semaphore-in-vapplicationtickhook/4847/1 "2012-05-29T16:38:03Z")

</div>

**[jandle](https://sourceforge.net/u/jandle/)** wrote on [Tuesday, May 29, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/d25ae140/#e3b1):

I recently added code that needs to acquire a semaphore (I suppose I could ignore it for what I want to do…) on a tick hook timer.&nbsp; Since calling

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xSemaphoreTake(xMutexMBREGS, usTime)

resets my dsPIC33, I am guessing that I need to use

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xSemaphoreTakeFromISR( xSemaphore, pxHigherPriorityTaskWoken )

Is this true?  
If so, and if pxHigherPriorityTaskWoken&nbsp; is true, do I really want to make the jump from the tick hook?

The end goal is to monitor data aging of MODBUS registers on the tick timer and to reset them to uninitialized if the app does not refresh them periodically.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 29, 2012, 4:42pm UTC](https://forums.freertos.org/t/take-give-semaphore-in-vapplicationtickhook/4847/2 "2012-05-29T16:42:16Z")

</div>

**[jandle](https://sourceforge.net/u/jandle/)** wrote on [Tuesday, May 29, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/d25ae140/#b952):

ah, search first, ask second…

[https://sourceforge.net/projects/freertos/forums/forum/382005/topic/3802065](https://sourceforge.net/projects/freertos/forums/forum/382005/topic/3802065)
