MOD54415 TimerTick

for everything else
Post Reply
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

MOD54415 TimerTick

Post by jediengineer »

So a long time ago, I found a bit of HTML in the factory demo that called the system for a tick count which would display the number of seconds that the system had been running for (TimeTick/TICKS_PER_SECOND) - I found the HTML code, but for the life of me I cannot find any reference to the function it calls for some reason. I need to store a DWORD of the total time the system was turned on for, can't find a reference to the system timer. Can someone point me in the right direction? Thanks!
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: MOD54415 TimerTick

Post by sulliwk06 »

I believe there is a Secs variable you can use.
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD54415 TimerTick

Post by jediengineer »

I couldn't find a "Secs" variable, but I did find this in utils.h:

Code: Select all

extern DWORD GetPreciseTime( void );              // Gets the time tick since system start at a higher
                                                  // resolution, depending on the platform:  0.868-us for
                                                  // MOD5234/70, and 1.929-us for MOD5282
From what I gather, it's keeping a tick count, each tick being 1/20th of a second? At least for the MOD5441X platforms... the header didn't specify anything for the MOD5441X family. If I'm wrong, someone please fill me in... thanks!
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54415 TimerTick

Post by dciliske »

Nope, that's not what GetPreciseTime does; it gets the sub-tick time from the hardware timer and returns the total hardware counts. This has a lower rollover than simply tracking TimeTick.

'Secs' is the name of the number of seconds since boot, it's declared as a VDWORD, or 'volatile unsigned long', inside 'ucos.c'. It is declared on line 62 of 'utils.h'

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: MOD54415 TimerTick

Post by pbreed »

To add to Dan's comment...

TimeTick is the number of ticks since boot.

From utils.h....

extern VDWORD Secs; // Number of seconds since system start
extern VDWORD TimeTick; // Number of time ticks since system start
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD54415 TimerTick

Post by jediengineer »

Thanks guys - appreciate it. Looks like what I was looking for! Apologies if that was too simple... I completely missed that when I looked in utils.h...
Post Reply