stopwatch 计时

This commit is contained in:
2026-07-19 17:55:03 +08:00
parent b21f91fd61
commit b9eb6a2319
3 changed files with 53 additions and 6 deletions
+14 -6
View File
@@ -69,15 +69,23 @@ void os_systick_tick(void){
OS_STATIC_FORCE_INLINE
os_tick_t os_systick_get(void){
#if 0
os_critical_enter();
os_tick_t ticks = g_os_systick_ticks;
os_critical_leave();
return ticks;
#endif
return g_os_systick_ticks;
}
OS_STATIC_FORCE_INLINE
os_tick_t os_systick_safe_get(void) {
os_critical_enter();
const os_tick_t ticks = g_os_systick_ticks;
os_critical_leave();
return ticks;
}
OS_STATIC_FORCE_INLINE
os_tick_t os_systick_safe_get_in_isr(void) {
os_critical_enter_in_isr();
const os_tick_t ticks = g_os_systick_ticks;
os_critical_leave_in_isr();
return ticks;
}
#endif /*INCLUDED_OS_SYSTICK_H*/