libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
esp_timebase.hpp
1#pragma once
2
3#include "esp_timer.h"
4#include "timebase.hpp"
5
6namespace LibXR
7{
8
15class ESP32Timebase : public Timebase
16{
17 public:
22 : Timebase(static_cast<uint64_t>(UINT64_MAX), UINT32_MAX)
23 {
24 }
25
31 {
32 return esp_timer_get_time();
33 }
34
40 {
41 return static_cast<MillisecondTimestamp>(esp_timer_get_time() / 1000) % UINT32_MAX;
42 }
43};
44
45} // namespace LibXR
ESP32 时间基准实现 / ESP32 timebase implementation.
ESP32Timebase()
构造函数 / Constructor
MillisecondTimestamp _get_milliseconds() override
获取当前毫秒计数 / Get current timestamp in milliseconds
MicrosecondTimestamp _get_microseconds() override
获取当前微秒计数 / Get current timestamp in microseconds
表示微秒级时间戳的类。Class representing a timestamp in microseconds.
表示毫秒级时间戳的类。Class representing a timestamp in milliseconds.
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps.
Definition timebase.hpp:18
LibXR 命名空间
Definition ch32_can.hpp:14