* Refactor `systimer` and `timer` modules into a common `timer` module * Update `CHANGELOG.md` * Rebase and update new example
14 lines
242 B
Rust
14 lines
242 B
Rust
#![no_std]
|
|
|
|
pub fn cycles() -> u64 {
|
|
#[cfg(feature = "esp32")]
|
|
{
|
|
esp_hal::xtensa_lx::timer::get_cycle_count() as u64
|
|
}
|
|
|
|
#[cfg(not(feature = "esp32"))]
|
|
{
|
|
esp_hal::timer::systimer::SystemTimer::now()
|
|
}
|
|
}
|