Zephyr C++ Toolkit
Loading...
Searching...
No Matches
Util.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
5
#include <zephyr/kernel.h>
6
7
namespace
zct
{
8
9
class
Util
{
10
public
:
24
static
void
sleepUntilSystemTime
(int64_t targetTimeMs)
25
{
26
int64_t currentTimeMs = k_uptime_get();
27
int64_t remainingTimeMs = targetTimeMs - currentTimeMs;
28
29
if
(remainingTimeMs > 0) {
30
k_sleep(K_MSEC(remainingTimeMs));
31
}
32
}
33
};
34
35
}
// namespace zct
zct::Util
Definition
Util.hpp:9
zct::Util::sleepUntilSystemTime
static void sleepUntilSystemTime(int64_t targetTimeMs)
Definition
Util.hpp:24
zct
Definition
Mutex.hpp:6
include
ZephyrCppToolkit
Core
Util.hpp
Generated by
1.9.8