drivers: nrf_rtc_timer: Remove unnecessary locking
As per description of the sys_clock_elapsed() function, "the kernel will call this with appropriate locking, the driver needs only provide an instantaneous answer". Remove then the unnecessary locking from the function, as it only adds an undesirable delay. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
59b21a29aa
commit
457a28bf78
1 changed files with 1 additions and 5 deletions
|
@ -386,11 +386,7 @@ uint32_t sys_clock_elapsed(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
k_spinlock_key_t key = k_spin_lock(&lock);
|
return counter_sub(counter(), last_count) / CYC_PER_TICK;
|
||||||
uint32_t ret = counter_sub(counter(), last_count) / CYC_PER_TICK;
|
|
||||||
|
|
||||||
k_spin_unlock(&lock, key);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t sys_clock_cycle_get_32(void)
|
uint32_t sys_clock_cycle_get_32(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue