diff options
| author | zhkag <[email protected]> | 2023-02-06 14:00:32 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2023-02-07 15:51:11 +0800 |
| commit | 7c1d6ffd3c10dfc0af8608ff1546a6a8b0d0b54c (patch) | |
| tree | d28242163d6e243cdcd906525b738f635e2451e8 /components/drivers/cputime | |
| parent | f4e9ec82bbfc1a7183fca6f7c7039ca2e3f1b992 (diff) | |
add clock_cpu_settimeout function
Diffstat (limited to 'components/drivers/cputime')
| -rw-r--r-- | components/drivers/cputime/cputime.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/components/drivers/cputime/cputime.c b/components/drivers/cputime/cputime.c index 22b56e6db2..b39e789cd2 100644 --- a/components/drivers/cputime/cputime.c +++ b/components/drivers/cputime/cputime.c @@ -44,6 +44,24 @@ uint64_t clock_cpu_gettime(void) } /** + * The clock_cpu_settimeout() fucntion set timeout time and timeout callback function + * The timeout callback function will be called when the timeout time is reached + * + * @param tick the Timeout tick + * @param timeout the Timeout function + * @param parameter the Parameters of timeout function + * + */ +void clock_cpu_settimeout(uint64_t tick, void (*timeout)(void *param), void *param) +{ + if (_cputime_ops) + return _cputime_ops->cputime_settimeout(tick, timeout, param); + + rt_set_errno(ENOSYS); + return 0; +} + +/** * The clock_cpu_microsecond() fucntion shall return the microsecond according to * cpu_tick parameter. * |
