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] [May 2008 Threads] How to use Timer in FreeRTOS?Posted by Mudassir Rasool on May 15, 2008 Hi all,
I have read other threads on using timers in FreeRTOS, and I have tried to use vApplicationTickHook. I have made a global variable "time_ticks" which is incremented on every call to vApplicationTickHook, But as I run the code, this hook is only triggered when my task is doing nothing, i.e when I call vTaskDelay. This means that I can only count the ticks of delay of a task. But I need a timer, e.g. I want to calculate how much time is taken by a particular code to run. So i want to save some timer value before starting the task, and then get the value of elapsed time after the task has finished its work.
How can I do it in FreeRTOS? Like in TinyOS, there is Timer module, and you can start a timer and stop it and take its value at any point of time.
Immediate response will be highly appreciated!
Thanks in advance, -- Mudassir
RE: How to use Timer in FreeRTOS?Posted by Richard on May 15, 2008 I can send you the timer module donated by Neil. If you would like a copy send me an email to r _dot barry {at} freertos.org.
Alternatively you can make uxTickCount global (provided you are using a 32bit port and uxTickCount is 32 bits, or you are using a 16 bit port and uxTickCount is 16bits] to give you access to the tick interrupt count.
Regards
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|