Skip to content

Generically take any duration? #92

@korken89

Description

@korken89

Hi, I have issues with getting the following code to compile as I am unable to get the correct traits needed.
Could you assist here @PTaylor-us ?

pub fn spawn_after<D: embedded_time::duration::Duration>(duration: D) -> Result<(), ()> {
    let instant = <MyClock as rtic::Monotonic>::now(); // Return an Instant<MyClock>

    // This addition seems to be the issue
    spawn_at(instant + duration, #(,#untupled)*)
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions