mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-24 05:04:10 +08:00
🐞 fix(components/drivers): fix cpu timer in multithreading (#7222)
* 🐞 fix(components/drivers): fix cpu timer in multithreading * 🎈 perf(components): change double to uint64_t * 🎈 perf(components): add UL suffix
This commit is contained in:
@@ -16,12 +16,12 @@
|
||||
|
||||
struct rt_clock_cputime_ops
|
||||
{
|
||||
double (*cputime_getres)(void);
|
||||
uint64_t (*cputime_getres)(void);
|
||||
uint64_t (*cputime_gettime)(void);
|
||||
int (*cputime_settimeout)(uint64_t tick, void (*timeout)(void *param), void *param);
|
||||
};
|
||||
|
||||
double clock_cpu_getres(void);
|
||||
uint64_t clock_cpu_getres(void);
|
||||
uint64_t clock_cpu_gettime(void);
|
||||
int clock_cpu_settimeout(uint64_t tick, void (*timeout)(void *param), void *param);
|
||||
int clock_cpu_issettimeout(void);
|
||||
|
||||
@@ -21,6 +21,7 @@ struct rt_cputimer
|
||||
void *parameter;
|
||||
rt_uint64_t init_tick;
|
||||
rt_uint64_t timeout_tick;
|
||||
struct rt_semaphore sem;
|
||||
};
|
||||
typedef struct rt_cputimer *rt_cputimer_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user