Forums - Timers

1 post / 0 new
Timers
iamcalledusman
Join Date: 29 Aug 19
Posts: 3
Posted: Thu, 2019-08-29 13:10

Hi All 

   My question is regarding the timers in CSR1010. Recently i am using the 4 timers 

#define MAX_TIMERS 4

#define Timer_Read_Sensor (50*MILLISECOND) //50ms

 

#define Timer_Six_Hour (60* SECOND) // 60 sec temp time

 

#define Timer_Thirty_Sec (10 * SECOND) // 10 second timer

 

#define Timer_Five_Sec (5* SECOND) // 5 second timer

 

similarly , 4 call backs against each timer 

for example

static void timerCallback_Read_Sensor(timer_id const id)

 

issue i am facing is that , i am using the 4 timers as mentioned above and my requirement is to run each timer on specfic event , Lets suppose i want to run 60and 10 seconds  seconds timers continously , But if a event occurs then 5 seconds timer should work and 10 and 60 seconds timers should be disable.

i am able to implement that logic using the flags . But issue is that when 5 seconds timer was running then 10 sec and 60sec timer also called / run .

Your help is required in this regard and greatly appreicated .

 

Should i need to use the DeleteTimer function for above mentined case ? Means to delete the remaining 2 timers while running the required timer which was activated by certain event . Am i right ? if yes can you please share a simple code example for that ?

 

Thanks in advance 

Regards

Usman

 

 

 

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.