Skip to content

Remaining/Elapsed timer calculation for generic clock #125

Open
@marius-meissner

Description

@marius-meissner

The following example is failing by unsatisfied trait bounds:

use embedded_time::{Clock};
use embedded_time::duration::{Microseconds};

fn test<C: Clock>(clock: C)
{
    let duration = Microseconds::new(100);
    let timer = clock.new_timer(duration).start().unwrap();
    timer.remaining();
}

Are there further trait bound required? I tried already some compiler suggestions, without success.
I would be very grateful for a brief hint in the right direction. Maybe this information could help others later on.

Thanks in advance!

Version: v0.12.1 @ rustc 1.60.0-nightly (88fb06a1f 2022-02-05)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions