measure the time

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

measure the time

Post by Pask »

i need to add this function in my code:

current time (time since system started) + delay (in microseconds)

how i can do it?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: measure the time

Post by Giovanni »

I don't understand what you mean.

If you need a delay look for halPolledDelay().

Giovanni
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

Re: measure the time

Post by Pask »

what is chTimeNow frequency?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: measure the time

Post by Giovanni »

Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

Re: measure the time

Post by Pask »

ok, with CH_FREQUENCY 1000, how many time need to restart the counter (The counter can reach its maximum and then restart from zero for chTimeNoe())?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: measure the time

Post by Giovanni »

2^32 / CH_FREQUENCY seconds
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

Re: measure the time

Post by Pask »

i want to modify CH_FREQUENCY in chconf.h. it is the same for all platforms ?
I tried to change it but the compiler give me : "make : Nothing to be done for ` all ' . "
I could alternatively set the timer GPT to a frequency of 1000 but is not accepted. I can see how the frequencies it accept?
Post Reply