Logo
Explore Help
Register Sign In
lby/lk
1
0
Fork 0
You've already forked lk
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
master
lk/platform/time.c

16 lines
367 B
C
Raw Permalink Normal View History

[debug] remove lib/debug and move to the top/ module Most of the functions for this was declared in a top level lk/ include space, so go ahead and move it there. A few exceptions: - Moved spin() over to platform/time.h and platform/time.c since the function more logically belongs to platform/time.h. Any users of spin() will need to update their headers to include platform/time.h instead. - Renamed spin_cycles() to arm_cm_spin_cycles() and moved over into arm/cm.h since it is currently defined in arch/arm-m and only used for targets that implicitly are for arm-m.
2025-09-20 16:03:24 -07:00
/*
* Copyright (c) 2025 Travis Geiselbrecht
*
* Use of this source code is governed by a MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT
*/
#include <platform/time.h>
void spin(uint32_t usecs) {
lk_bigtime_t start = current_time_hires();
while ((current_time_hires() - start) < usecs)
;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 47ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API