nrf-hal icon indicating copy to clipboard operation
nrf-hal copied to clipboard

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

Open relia1 opened this issue 1 year ago • 1 comments

Configuration/Setup Information

  • Microbit v2 firmware v258
  • I have the nrf-rs/microbit repository pulled down locally with the microbit-common/Cargo.toml updated so nrf52833-hal v0.16.1 is being used
  • My local version of microbit is forked from this branch https://github.com/nrf-rs/microbit/pull/123

Steps to reproduce

  • Unzip attached .zip for the program I ran that ran into this
  • Pull down a version of microbit based on the above PR and update the Cargo.toml to point to nrf52833-hal v0.16.1
  • cargo run

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

  • Expected the DelayNs trait to be implemented

Attached zip

DelayNs.zip

relia1 avatar Mar 08 '24 19:03 relia1

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.

qwandor avatar Mar 12 '24 13:03 qwandor