File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ typedef struct pbio_os_timer_t {
7171
7272void pbio_os_timer_set (pbio_os_timer_t * timer , uint32_t duration );
7373
74+ void pbio_os_timer_extend (pbio_os_timer_t * timer );
75+
7476bool pbio_os_timer_is_expired (pbio_os_timer_t * timer );
7577
7678/**
Original file line number Diff line number Diff line change @@ -24,6 +24,17 @@ void pbio_os_timer_set(pbio_os_timer_t *timer, uint32_t duration) {
2424 timer -> duration = duration ;
2525}
2626
27+ /**
28+ * Extends the timeout by incrementing the start time by the duration.
29+ *
30+ * Duration must have been set by ::pbio_os_timer_set previously.
31+ *
32+ * @param timer The timer whose timeout to extend.
33+ */
34+ void pbio_os_timer_extend (pbio_os_timer_t * timer ) {
35+ timer -> start += timer -> duration ;
36+ }
37+
2738/**
2839 * Whether the timer has expired.
2940 *
You can’t perform that action at this time.
0 commit comments