nrf-rs / nrf-hal

A Rust HAL for the nRF family of devices
Apache License 2.0
484 stars 135 forks source link

The trait `embedded_hal::delay::DelayNs` is not implemented for `Timer<microbit::nrf52833_pac::TIMER0>` #437

Open relia1 opened 4 months ago

relia1 commented 4 months ago

Configuration/Setup Information

Steps to reproduce

Results

error[E0277]: the trait bound `Timer<microbit::nrf52833_pac::TIMER0>: embedded_hal::delay::DelayNs` is not satisfied
   --> src/main.rs:43:22
    |
43  |         display.show(&mut timer, fb, 100);
    |                 ---- ^^^^^^^^^^ the trait `embedded_hal::delay::DelayNs` is not implemented for `Timer<microbit::nrf52833_pac::TIMER0>`
    |                 |
    |                 required by a bound introduced by this call
    |
    = help: the trait `embedded_hal::delay::DelayNs` is implemented for `&mut T`
note: required by a bound in `microbit::display::blocking::Display::show`
   --> /Users/robert/open_source/microbit/microbit-common/src/display/blocking.rs:145:20
    |
145 |     pub fn show<D: DelayNs>(&mut self, delay: &mut D, led_display: [[u8; 5]; 5], duration_ms: u32) {
    |                    ^^^^^^^ required by this bound in `Display::show`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `poll-buttons` (bin "poll-buttons") due to previous error

Expected

Attached zip

DelayNs.zip

qwandor commented 4 months ago

I tried to reproduce this locally with just the nrf52833-hal package and couldn't, so I suspect there is something weird going on with versions. I'll leave this open for now but please try again once we have released versions of everything.