diff options
| author | xqyjlj <[email protected]> | 2023-10-25 20:31:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-25 20:31:25 +0800 |
| commit | 3283f54c7a0444b2e51ec79a4da57e7871528f05 (patch) | |
| tree | e4bcd748ad2362f16d0dea5c5da62922de466999 /components/drivers/ktime | |
| parent | 91fc52df3635d5dda8285616420f08efa79cea04 (diff) | |
🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)
Signed-off-by: Shell <[email protected]>
Co-authored-by: Shell <[email protected]>
Diffstat (limited to 'components/drivers/ktime')
| -rw-r--r-- | components/drivers/ktime/src/hrtimer.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/components/drivers/ktime/src/hrtimer.c b/components/drivers/ktime/src/hrtimer.c index 5905d5e34b..f22f39e128 100644 --- a/components/drivers/ktime/src/hrtimer.c +++ b/components/drivers/ktime/src/hrtimer.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2023-07-10 xqyjlj The first version. + * 2023-09-15 xqyjlj perf rt_hw_interrupt_disable/enable */ #include <rtdevice.h> @@ -22,7 +23,7 @@ static rt_list_t _timer_list = RT_LIST_OBJECT_INIT(_timer_list); static rt_ktime_hrtimer_t _nowtimer = RT_NULL; -static struct rt_spinlock _spinlock; +static RT_DEFINE_SPINLOCK(_spinlock); rt_weak unsigned long rt_ktime_hrtimer_getres(void) { @@ -389,11 +390,3 @@ rt_err_t rt_ktime_hrtimer_mdelay(unsigned long ms) { return rt_ktime_hrtimer_ndelay(ms * 1000000); } - -static int rt_ktime_hrtimer_lock_init(void) -{ - RT_UNUSED(_spinlock); - rt_spin_lock_init(&_spinlock); - return 0; -} -INIT_BOARD_EXPORT(rt_ktime_hrtimer_lock_init); |
