mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-20 15:35:05 +00:00
Fixes
This commit is contained in:
parent
f6dfc04cb8
commit
2284fb8a69
@ -129,7 +129,7 @@ std::unique_ptr<Uart> open(uart_port_t port) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Uart> open(std::string name) {
|
std::unique_ptr<Uart> open(std::string name) {
|
||||||
LOGGER.info("Open %s", name.c_str());
|
LOGGER.info("Open {}", name.c_str());
|
||||||
|
|
||||||
auto result = std::views::filter(uartEntries, [&name](auto& entry) {
|
auto result = std::views::filter(uartEntries, [&name](auto& entry) {
|
||||||
return entry.configuration.name == name;
|
return entry.configuration.name == name;
|
||||||
|
|||||||
@ -13,12 +13,14 @@ namespace tt {
|
|||||||
static uint64_t getLogTimestamp() {
|
static uint64_t getLogTimestamp() {
|
||||||
static uint64_t base = 0U;
|
static uint64_t base = 0U;
|
||||||
static std::once_flag init_flag;
|
static std::once_flag init_flag;
|
||||||
|
std::call_once(init_flag, []() {
|
||||||
|
timeval time {};
|
||||||
|
gettimeofday(&time, nullptr);
|
||||||
|
base = ((uint64_t)time.tv_sec * 1000U) + (time.tv_usec / 1000U);
|
||||||
|
});
|
||||||
timeval time {};
|
timeval time {};
|
||||||
gettimeofday(&time, nullptr);
|
gettimeofday(&time, nullptr);
|
||||||
uint64_t now = ((uint64_t)time.tv_sec * 1000U) + (time.tv_usec / 1000U);
|
uint64_t now = ((uint64_t)time.tv_sec * 1000U) + (time.tv_usec / 1000U);
|
||||||
std::call_once(init_flag, [now]() {
|
|
||||||
base = now;
|
|
||||||
});
|
|
||||||
return now - base;
|
return now - base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user