Skip to content

Commit

Permalink
Add more tick rates
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Sep 28, 2023
1 parent b9ef831 commit 98d6da4
Show file tree
Hide file tree
Showing 3 changed files with 248 additions and 1 deletion.
61 changes: 61 additions & 0 deletions embassy-time/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,68 @@ tick-hz-384_000_000 = []
tick-hz-512_000_000 = []
tick-hz-576_000_000 = []
tick-hz-768_000_000 = []
tick-hz-20_000_000 = []
tick-hz-30_000_000 = []
tick-hz-40_000_000 = []
tick-hz-50_000_000 = []
tick-hz-60_000_000 = []
tick-hz-70_000_000 = []
tick-hz-80_000_000 = []
tick-hz-90_000_000 = []
tick-hz-110_000_000 = []
tick-hz-120_000_000 = []
tick-hz-130_000_000 = []
tick-hz-140_000_000 = []
tick-hz-150_000_000 = []
tick-hz-160_000_000 = []
tick-hz-170_000_000 = []
tick-hz-180_000_000 = []
tick-hz-190_000_000 = []
tick-hz-200_000_000 = []
tick-hz-210_000_000 = []
tick-hz-220_000_000 = []
tick-hz-230_000_000 = []
tick-hz-240_000_000 = []
tick-hz-250_000_000 = []
tick-hz-260_000_000 = []
tick-hz-270_000_000 = []
tick-hz-280_000_000 = []
tick-hz-290_000_000 = []
tick-hz-300_000_000 = []
tick-hz-320_000_000 = []
tick-hz-340_000_000 = []
tick-hz-360_000_000 = []
tick-hz-380_000_000 = []
tick-hz-400_000_000 = []
tick-hz-420_000_000 = []
tick-hz-440_000_000 = []
tick-hz-460_000_000 = []
tick-hz-480_000_000 = []
tick-hz-500_000_000 = []
tick-hz-520_000_000 = []
tick-hz-540_000_000 = []
tick-hz-560_000_000 = []
tick-hz-580_000_000 = []
tick-hz-600_000_000 = []
tick-hz-620_000_000 = []
tick-hz-640_000_000 = []
tick-hz-660_000_000 = []
tick-hz-680_000_000 = []
tick-hz-700_000_000 = []
tick-hz-720_000_000 = []
tick-hz-740_000_000 = []
tick-hz-760_000_000 = []
tick-hz-780_000_000 = []
tick-hz-800_000_000 = []
tick-hz-820_000_000 = []
tick-hz-840_000_000 = []
tick-hz-860_000_000 = []
tick-hz-880_000_000 = []
tick-hz-900_000_000 = []
tick-hz-920_000_000 = []
tick-hz-940_000_000 = []
tick-hz-960_000_000 = []
tick-hz-980_000_000 = []
# END TICKS

[dependencies]
Expand Down
5 changes: 4 additions & 1 deletion embassy-time/gen_tick.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
ticks.append(2**i * 1000000)
ticks.append(2**i * 9 // 8 * 1000000)
ticks.append(2**i * 3 // 2 * 1000000)
ticks.append(80_000_000)
for i in range(1, 30):
ticks.append(10 * i * 1_000_000)
for i in range(15, 50):
ticks.append(20 * i * 1_000_000)

seen = set()
ticks = [x for x in ticks if not (x in seen or seen.add(x))]
Expand Down
183 changes: 183 additions & 0 deletions embassy-time/src/tick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,130 @@ pub const TICK_HZ: u64 = 512_000_000;
pub const TICK_HZ: u64 = 576_000_000;
#[cfg(feature = "tick-hz-768_000_000")]
pub const TICK_HZ: u64 = 768_000_000;
#[cfg(feature = "tick-hz-20_000_000")]
pub const TICK_HZ: u64 = 20_000_000;
#[cfg(feature = "tick-hz-30_000_000")]
pub const TICK_HZ: u64 = 30_000_000;
#[cfg(feature = "tick-hz-40_000_000")]
pub const TICK_HZ: u64 = 40_000_000;
#[cfg(feature = "tick-hz-50_000_000")]
pub const TICK_HZ: u64 = 50_000_000;
#[cfg(feature = "tick-hz-60_000_000")]
pub const TICK_HZ: u64 = 60_000_000;
#[cfg(feature = "tick-hz-70_000_000")]
pub const TICK_HZ: u64 = 70_000_000;
#[cfg(feature = "tick-hz-80_000_000")]
pub const TICK_HZ: u64 = 80_000_000;
#[cfg(feature = "tick-hz-90_000_000")]
pub const TICK_HZ: u64 = 90_000_000;
#[cfg(feature = "tick-hz-110_000_000")]
pub const TICK_HZ: u64 = 110_000_000;
#[cfg(feature = "tick-hz-120_000_000")]
pub const TICK_HZ: u64 = 120_000_000;
#[cfg(feature = "tick-hz-130_000_000")]
pub const TICK_HZ: u64 = 130_000_000;
#[cfg(feature = "tick-hz-140_000_000")]
pub const TICK_HZ: u64 = 140_000_000;
#[cfg(feature = "tick-hz-150_000_000")]
pub const TICK_HZ: u64 = 150_000_000;
#[cfg(feature = "tick-hz-160_000_000")]
pub const TICK_HZ: u64 = 160_000_000;
#[cfg(feature = "tick-hz-170_000_000")]
pub const TICK_HZ: u64 = 170_000_000;
#[cfg(feature = "tick-hz-180_000_000")]
pub const TICK_HZ: u64 = 180_000_000;
#[cfg(feature = "tick-hz-190_000_000")]
pub const TICK_HZ: u64 = 190_000_000;
#[cfg(feature = "tick-hz-200_000_000")]
pub const TICK_HZ: u64 = 200_000_000;
#[cfg(feature = "tick-hz-210_000_000")]
pub const TICK_HZ: u64 = 210_000_000;
#[cfg(feature = "tick-hz-220_000_000")]
pub const TICK_HZ: u64 = 220_000_000;
#[cfg(feature = "tick-hz-230_000_000")]
pub const TICK_HZ: u64 = 230_000_000;
#[cfg(feature = "tick-hz-240_000_000")]
pub const TICK_HZ: u64 = 240_000_000;
#[cfg(feature = "tick-hz-250_000_000")]
pub const TICK_HZ: u64 = 250_000_000;
#[cfg(feature = "tick-hz-260_000_000")]
pub const TICK_HZ: u64 = 260_000_000;
#[cfg(feature = "tick-hz-270_000_000")]
pub const TICK_HZ: u64 = 270_000_000;
#[cfg(feature = "tick-hz-280_000_000")]
pub const TICK_HZ: u64 = 280_000_000;
#[cfg(feature = "tick-hz-290_000_000")]
pub const TICK_HZ: u64 = 290_000_000;
#[cfg(feature = "tick-hz-300_000_000")]
pub const TICK_HZ: u64 = 300_000_000;
#[cfg(feature = "tick-hz-320_000_000")]
pub const TICK_HZ: u64 = 320_000_000;
#[cfg(feature = "tick-hz-340_000_000")]
pub const TICK_HZ: u64 = 340_000_000;
#[cfg(feature = "tick-hz-360_000_000")]
pub const TICK_HZ: u64 = 360_000_000;
#[cfg(feature = "tick-hz-380_000_000")]
pub const TICK_HZ: u64 = 380_000_000;
#[cfg(feature = "tick-hz-400_000_000")]
pub const TICK_HZ: u64 = 400_000_000;
#[cfg(feature = "tick-hz-420_000_000")]
pub const TICK_HZ: u64 = 420_000_000;
#[cfg(feature = "tick-hz-440_000_000")]
pub const TICK_HZ: u64 = 440_000_000;
#[cfg(feature = "tick-hz-460_000_000")]
pub const TICK_HZ: u64 = 460_000_000;
#[cfg(feature = "tick-hz-480_000_000")]
pub const TICK_HZ: u64 = 480_000_000;
#[cfg(feature = "tick-hz-500_000_000")]
pub const TICK_HZ: u64 = 500_000_000;
#[cfg(feature = "tick-hz-520_000_000")]
pub const TICK_HZ: u64 = 520_000_000;
#[cfg(feature = "tick-hz-540_000_000")]
pub const TICK_HZ: u64 = 540_000_000;
#[cfg(feature = "tick-hz-560_000_000")]
pub const TICK_HZ: u64 = 560_000_000;
#[cfg(feature = "tick-hz-580_000_000")]
pub const TICK_HZ: u64 = 580_000_000;
#[cfg(feature = "tick-hz-600_000_000")]
pub const TICK_HZ: u64 = 600_000_000;
#[cfg(feature = "tick-hz-620_000_000")]
pub const TICK_HZ: u64 = 620_000_000;
#[cfg(feature = "tick-hz-640_000_000")]
pub const TICK_HZ: u64 = 640_000_000;
#[cfg(feature = "tick-hz-660_000_000")]
pub const TICK_HZ: u64 = 660_000_000;
#[cfg(feature = "tick-hz-680_000_000")]
pub const TICK_HZ: u64 = 680_000_000;
#[cfg(feature = "tick-hz-700_000_000")]
pub const TICK_HZ: u64 = 700_000_000;
#[cfg(feature = "tick-hz-720_000_000")]
pub const TICK_HZ: u64 = 720_000_000;
#[cfg(feature = "tick-hz-740_000_000")]
pub const TICK_HZ: u64 = 740_000_000;
#[cfg(feature = "tick-hz-760_000_000")]
pub const TICK_HZ: u64 = 760_000_000;
#[cfg(feature = "tick-hz-780_000_000")]
pub const TICK_HZ: u64 = 780_000_000;
#[cfg(feature = "tick-hz-800_000_000")]
pub const TICK_HZ: u64 = 800_000_000;
#[cfg(feature = "tick-hz-820_000_000")]
pub const TICK_HZ: u64 = 820_000_000;
#[cfg(feature = "tick-hz-840_000_000")]
pub const TICK_HZ: u64 = 840_000_000;
#[cfg(feature = "tick-hz-860_000_000")]
pub const TICK_HZ: u64 = 860_000_000;
#[cfg(feature = "tick-hz-880_000_000")]
pub const TICK_HZ: u64 = 880_000_000;
#[cfg(feature = "tick-hz-900_000_000")]
pub const TICK_HZ: u64 = 900_000_000;
#[cfg(feature = "tick-hz-920_000_000")]
pub const TICK_HZ: u64 = 920_000_000;
#[cfg(feature = "tick-hz-940_000_000")]
pub const TICK_HZ: u64 = 940_000_000;
#[cfg(feature = "tick-hz-960_000_000")]
pub const TICK_HZ: u64 = 960_000_000;
#[cfg(feature = "tick-hz-980_000_000")]
pub const TICK_HZ: u64 = 980_000_000;
#[cfg(not(any(
feature = "tick-hz-1",
feature = "tick-hz-10",
Expand Down Expand Up @@ -237,6 +359,67 @@ pub const TICK_HZ: u64 = 80_000_000;
feature = "tick-hz-512_000_000",
feature = "tick-hz-576_000_000",
feature = "tick-hz-768_000_000",
feature = "tick-hz-20_000_000",
feature = "tick-hz-30_000_000",
feature = "tick-hz-40_000_000",
feature = "tick-hz-50_000_000",
feature = "tick-hz-60_000_000",
feature = "tick-hz-70_000_000",
feature = "tick-hz-80_000_000",
feature = "tick-hz-90_000_000",
feature = "tick-hz-110_000_000",
feature = "tick-hz-120_000_000",
feature = "tick-hz-130_000_000",
feature = "tick-hz-140_000_000",
feature = "tick-hz-150_000_000",
feature = "tick-hz-160_000_000",
feature = "tick-hz-170_000_000",
feature = "tick-hz-180_000_000",
feature = "tick-hz-190_000_000",
feature = "tick-hz-200_000_000",
feature = "tick-hz-210_000_000",
feature = "tick-hz-220_000_000",
feature = "tick-hz-230_000_000",
feature = "tick-hz-240_000_000",
feature = "tick-hz-250_000_000",
feature = "tick-hz-260_000_000",
feature = "tick-hz-270_000_000",
feature = "tick-hz-280_000_000",
feature = "tick-hz-290_000_000",
feature = "tick-hz-300_000_000",
feature = "tick-hz-320_000_000",
feature = "tick-hz-340_000_000",
feature = "tick-hz-360_000_000",
feature = "tick-hz-380_000_000",
feature = "tick-hz-400_000_000",
feature = "tick-hz-420_000_000",
feature = "tick-hz-440_000_000",
feature = "tick-hz-460_000_000",
feature = "tick-hz-480_000_000",
feature = "tick-hz-500_000_000",
feature = "tick-hz-520_000_000",
feature = "tick-hz-540_000_000",
feature = "tick-hz-560_000_000",
feature = "tick-hz-580_000_000",
feature = "tick-hz-600_000_000",
feature = "tick-hz-620_000_000",
feature = "tick-hz-640_000_000",
feature = "tick-hz-660_000_000",
feature = "tick-hz-680_000_000",
feature = "tick-hz-700_000_000",
feature = "tick-hz-720_000_000",
feature = "tick-hz-740_000_000",
feature = "tick-hz-760_000_000",
feature = "tick-hz-780_000_000",
feature = "tick-hz-800_000_000",
feature = "tick-hz-820_000_000",
feature = "tick-hz-840_000_000",
feature = "tick-hz-860_000_000",
feature = "tick-hz-880_000_000",
feature = "tick-hz-900_000_000",
feature = "tick-hz-920_000_000",
feature = "tick-hz-940_000_000",
feature = "tick-hz-960_000_000",
feature = "tick-hz-980_000_000",
)))]
pub const TICK_HZ: u64 = 1_000_000;

0 comments on commit 98d6da4

Please sign in to comment.