Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-03-2017, 04:52 AM   #1
LQ Newbie
Registered: Jul 2017
Posts: 1

Rep: Reputation: Disabled
High Resolution Timer problem

Hello there,

I am curently working on a Linux-based operating system called Nuttx on pixhawk architecture : .

I am implementing a periodic called function with HRT library. Here is my code :

int debug_thread_main(int argc, char *argv[]);
hrt_callout tocall(void);

int debug_main(int argc, char *argv[])
  //Task create , max priority, stack size=2000
                     (char * const *)&argv[0]);
  return OK;

int debug_thread_main(int argc, char *argv[])
 struct hrt_call entry;
 //hrt_abstime in ms
 hrt_abstime delay=1000, interval=1000;


 hrt_call_every( &entry, delay, interval,tocall(),NULL);

 return 0;

hrt_callout tocall(void) {                // Where: typedef void (* hrt_callout)(void *arg);
 hrt_abstime time = hrt_absolute_time();
 PX4_INFO("I am call at : %d", time); 
 return tocall(); 
My problem is that the timer always stay at the same value 'time=240' or in hexa 0xf0:

So the call_every function is not working well, interval delay is not working and the function is call as if it was in a while(1) loop.

Thanks for helping me

Last edited by tleroyy; 07-03-2017 at 05:00 AM.
Old 07-22-2017, 03:48 AM   #2
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
Hello, and welcome to LQ! Sorry your post didn't get a reply on LQ,
but it is very specialized (vs. general Linux). Looks like you solved it:
>"somehow I made it works using directly the clock_gettime() function."

Anyways, I hope you don't give up on LQ: it's a GREAT forum

And 'best wishes' on what sounds like a great project!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to write a high resolution timer krishnammanaidu Linux - Newbie 3 06-18-2014 08:32 AM
High Resolution Timer Support???? Southpaw76 Linux - Kernel 2 11-20-2009 02:46 AM
Check for high resolution timer nonis Linux - Software 3 05-04-2009 07:24 AM
High Resolution Timer over 1000hz antidelldude Linux - General 0 01-29-2008 07:10 AM
[n] Slackware High Resolution Problem nirav_patel Slackware 9 05-13-2005 04:08 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration