Skip to content

Commit

Permalink
Merge pull request #2111 from yodaldevoid/more-ticks
Browse files Browse the repository at this point in the history
time: Add tick rates in multiples of 10 kHz
  • Loading branch information
Dirbaio authored Oct 24, 2023
2 parents b3879ec + ceb0d0b commit f956d19
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
4 changes: 4 additions & 0 deletions embassy-time/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.6 - ???

- Added tick rates in multiples of 10 kHz

## 0.1.5 - 2023-10-16

- Added `links` key to Cargo.toml, to prevent multiple copies of this crate in the same binary.
Expand Down
19 changes: 19 additions & 0 deletions embassy-time/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,25 @@ tick-hz-65_536_000 = []
tick-hz-131_072_000 = []
tick-hz-262_144_000 = []
tick-hz-524_288_000 = []
tick-hz-20_000 = []
tick-hz-40_000 = []
tick-hz-80_000 = []
tick-hz-160_000 = []
tick-hz-320_000 = []
tick-hz-640_000 = []
tick-hz-1_280_000 = []
tick-hz-2_560_000 = []
tick-hz-5_120_000 = []
tick-hz-10_240_000 = []
tick-hz-20_480_000 = []
tick-hz-40_960_000 = []
tick-hz-81_920_000 = []
tick-hz-163_840_000 = []
tick-hz-327_680_000 = []
tick-hz-655_360_000 = []
tick-hz-1_310_720_000 = []
tick-hz-2_621_440_000 = []
tick-hz-5_242_880_000 = []
tick-hz-2_000_000 = []
tick-hz-3_000_000 = []
tick-hz-4_000_000 = []
Expand Down
2 changes: 2 additions & 0 deletions embassy-time/gen_tick.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
ticks.append(2**i)
for i in range(1, 20):
ticks.append(2**i * 1000)
for i in range(1, 20):
ticks.append(2**i * 10000)
for i in range(1, 10):
ticks.append(2**i * 1000000)
ticks.append(2**i * 9 // 8 * 1000000)
Expand Down
57 changes: 57 additions & 0 deletions embassy-time/src/tick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,44 @@ pub const TICK_HZ: u64 = 131_072_000;
pub const TICK_HZ: u64 = 262_144_000;
#[cfg(feature = "tick-hz-524_288_000")]
pub const TICK_HZ: u64 = 524_288_000;
#[cfg(feature = "tick-hz-20_000")]
pub const TICK_HZ: u64 = 20_000;
#[cfg(feature = "tick-hz-40_000")]
pub const TICK_HZ: u64 = 40_000;
#[cfg(feature = "tick-hz-80_000")]
pub const TICK_HZ: u64 = 80_000;
#[cfg(feature = "tick-hz-160_000")]
pub const TICK_HZ: u64 = 160_000;
#[cfg(feature = "tick-hz-320_000")]
pub const TICK_HZ: u64 = 320_000;
#[cfg(feature = "tick-hz-640_000")]
pub const TICK_HZ: u64 = 640_000;
#[cfg(feature = "tick-hz-1_280_000")]
pub const TICK_HZ: u64 = 1_280_000;
#[cfg(feature = "tick-hz-2_560_000")]
pub const TICK_HZ: u64 = 2_560_000;
#[cfg(feature = "tick-hz-5_120_000")]
pub const TICK_HZ: u64 = 5_120_000;
#[cfg(feature = "tick-hz-10_240_000")]
pub const TICK_HZ: u64 = 10_240_000;
#[cfg(feature = "tick-hz-20_480_000")]
pub const TICK_HZ: u64 = 20_480_000;
#[cfg(feature = "tick-hz-40_960_000")]
pub const TICK_HZ: u64 = 40_960_000;
#[cfg(feature = "tick-hz-81_920_000")]
pub const TICK_HZ: u64 = 81_920_000;
#[cfg(feature = "tick-hz-163_840_000")]
pub const TICK_HZ: u64 = 163_840_000;
#[cfg(feature = "tick-hz-327_680_000")]
pub const TICK_HZ: u64 = 327_680_000;
#[cfg(feature = "tick-hz-655_360_000")]
pub const TICK_HZ: u64 = 655_360_000;
#[cfg(feature = "tick-hz-1_310_720_000")]
pub const TICK_HZ: u64 = 1_310_720_000;
#[cfg(feature = "tick-hz-2_621_440_000")]
pub const TICK_HZ: u64 = 2_621_440_000;
#[cfg(feature = "tick-hz-5_242_880_000")]
pub const TICK_HZ: u64 = 5_242_880_000;
#[cfg(feature = "tick-hz-2_000_000")]
pub const TICK_HZ: u64 = 2_000_000;
#[cfg(feature = "tick-hz-3_000_000")]
Expand Down Expand Up @@ -334,6 +372,25 @@ pub const TICK_HZ: u64 = 980_000_000;
feature = "tick-hz-131_072_000",
feature = "tick-hz-262_144_000",
feature = "tick-hz-524_288_000",
feature = "tick-hz-20_000",
feature = "tick-hz-40_000",
feature = "tick-hz-80_000",
feature = "tick-hz-160_000",
feature = "tick-hz-320_000",
feature = "tick-hz-640_000",
feature = "tick-hz-1_280_000",
feature = "tick-hz-2_560_000",
feature = "tick-hz-5_120_000",
feature = "tick-hz-10_240_000",
feature = "tick-hz-20_480_000",
feature = "tick-hz-40_960_000",
feature = "tick-hz-81_920_000",
feature = "tick-hz-163_840_000",
feature = "tick-hz-327_680_000",
feature = "tick-hz-655_360_000",
feature = "tick-hz-1_310_720_000",
feature = "tick-hz-2_621_440_000",
feature = "tick-hz-5_242_880_000",
feature = "tick-hz-2_000_000",
feature = "tick-hz-3_000_000",
feature = "tick-hz-4_000_000",
Expand Down

0 comments on commit f956d19

Please sign in to comment.