hannobraun / rust-dwm1001

[DEPRECATED] This repository was merged with https://github.com/braun-embedded/rust-dw1000
BSD Zero Clause License
14 stars 7 forks source link

Fix compilation of deprecated function use #58

Closed nbigaouette closed 6 years ago

nbigaouette commented 6 years ago

Compiling 093dfe69579a11945277b668dd3d75b225232a10 using cargo build --example blink --features="dev rt" fails with:

[...]
   Compiling dwm1001 v0.1.0 (/Users/nbigaouette/rust-dwm1001.git)
error: use of deprecated item 'cortex_m::peripheral::nvic::<impl cortex_m::peripheral::NVIC>::clear_pending': Use `NVIC::unpend`
   --> src/lib.rs:719:18
    |
719 |             nvic.clear_pending(Interrupt::GPIOTE);
    |                  ^^^^^^^^^^^^^
    |
note: lint level defined here
   --> src/lib.rs:9:9
    |
9   | #![deny(warnings)]
    |         ^^^^^^^^
    = note: #[deny(deprecated)] implied by #[deny(warnings)]

error: use of deprecated item 'cortex_m::peripheral::nvic::<impl cortex_m::peripheral::NVIC>::clear_pending': Use `NVIC::unpend`
   --> src/lib.rs:720:18
    |
720 |             nvic.clear_pending(T::INTERRUPT);
    |                  ^^^^^^^^^^^^^

error: aborting due to 2 previous errors

error: Could not compile `dwm1001`.
warning: build failed, waiting for other jobs to finish...
error: build failed

This PR will use nrf52::NVIC::unpend() instead to fix compilation.

I'm not sure if it's the proper way to fix this, but at least it compiles! :D