Commit graph

3 commits

Author SHA1 Message Date
XANTRONIX Development
55d40749a4 Fix patty_timer_start()
Fix patty_timer_start() to only set the running timer to the value of
the timer being started, rather than adding the value of the started
timer to the running timer
2024-03-01 00:20:46 -05:00
XANTRONIX Development
d6fbea1824 Fix patty_timer_expired()
Fix patty_timer_expired() to only check the tv_sec field for a value <=0
when testing for expiry
2024-03-01 00:20:46 -05:00
XANTRONIX Development
e10ce6b8e1 Implement generic timer functions in src/timer.c
Changes:

    * Implement patty_timer_expired() to determine if a timer has
      expired or has gone negative

    * Implement patty_timer_cancel() to set a timer to zero

    * Implement patty_timer_start() to initialize a timer, add a
      specified number of milliseconds, and ensure a target timer (such
      as the server timer) is set for at least that value as well

    * Implement patty_timer_tick() to subtract an elapsed time value
      from a timer

    * Remove functions specific to each timer in src/sock.c, as those
      can now be handled generically by src/timer.c

    * Replace calls to patty_ax25_sock_timer_t1_*() with patty_timer_*()
      calls instead; reference the struct timeval objects directly
      within the sock (for the time being, pending opaque structures)
2024-03-01 00:20:46 -05:00