How can I re assign my timer configured using rtc_timeout_expired(to). I want to re assign the to value before expiring the timer in code warrior MC9S08QE micro

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I re assign my timer configured using rtc_timeout_expired(to). I want to re assign the to value before expiring the timer in code warrior MC9S08QE micro

311 Views
arunsoman
Contributor I

I want to read the value of a pin 17,  the value is "one" then I want to set pin number 17.

a = gpio_get(XPIN_24); /* reading value from  GPIO 12 */
if (a == 1)

gpio_set(XPIN_17,a);     /* a is one then turn on pin 17 */

rtc_set_timeout(to) ;  /* set the timer with to = 30 seconds  */

Then I am continuously checking  pin number 24 (XPIN_24) , if it is "one"  then I have to extend my time out time for example rtc_set_timeout() will decrease by one in system tick , before reaching zero I want to reassign to new "to" value . When I am re assigning  rtc_set_timeout(to) ; I am getting wearied output .

My question is : How can I reinitialize   timer before reaching zero.

0 Kudos
0 Replies