@@ -23,69 +23,3 @@ impl U32Ext for u32 {
2323 Bps :: from_raw ( self )
2424 }
2525}
26-
27- /*
28- // Implement conversion from time periods into core::time::Duration
29- impl From<MilliSeconds> for Duration {
30- fn from(ms: MilliSeconds) -> Self {
31- Self::from_millis(ms.0 as u64)
32- }
33- }
34-
35- impl From<MicroSeconds> for Duration {
36- fn from(us: MicroSeconds) -> Self {
37- Self::from_micros(us.0 as u64)
38- }
39- }
40-
41- impl From<NanoSeconds> for Duration {
42- fn from(ns: NanoSeconds) -> Self {
43- Self::from_nanos(ns.0 as u64)
44- }
45- }
46- */
47-
48- // /// A monotonic nondecreasing timer
49- // #[derive(Clone, Copy)]
50- // pub struct MonoTimer {
51- // frequency: Hertz,
52- // }
53-
54- // impl MonoTimer {
55- // /// Creates a new `Monotonic` timer
56- // pub fn new(mut dwt: DWT, clocks: Clocks) -> Self {
57- // dwt.enable_cycle_counter();
58-
59- // // now the CYCCNT counter can't be stopped or resetted
60- // drop(dwt);
61-
62- // MonoTimer {
63- // frequency: clocks.sysclk(),
64- // }
65- // }
66-
67- // /// Returns the frequency at which the monotonic timer is operating at
68- // pub fn frequency(&self) -> Hertz {
69- // self.frequency
70- // }
71-
72- // /// Returns an `Instant` corresponding to "now"
73- // pub fn now(&self) -> Instant {
74- // Instant {
75- // now: DWT::cycle_count(),
76- // }
77- // }
78- // }
79-
80- /// A measurement of a monotonically nondecreasing clock
81- #[ derive( Clone , Copy ) ]
82- pub struct Instant {
83- now : u32 ,
84- }
85-
86- impl Instant {
87- /// Ticks elapsed since the `Instant` was created
88- pub fn elapsed ( & self ) -> u32 {
89- DWT :: cycle_count ( ) . wrapping_sub ( self . now )
90- }
91- }
0 commit comments