Closed a-camarillo closed 2 months ago
Would it be possible to paste a before-and-after of Cargo.lock
? Would be nice to know what versions are involved here.
Here is the Cargo.lock with use embedded_hal::digital::OutputPin;
and the build failing.
Here is the Cargo.lock with use microbit::hal::prelude::OutputPin;
and the build succeeding.
edit: after looking through the above I don't notice any difference in version numbers, I might have misunderstood the before-and-after part of your request
Yeah, you'll need to delete Cargo.lock
before each build, as it's cumulative.
You can see that Cargo.lock
currently contains both embedded_hal
0.2.7 and embedded_hal
1.0.0. This is what I was wondering about: with both versions in there things may go awry.
I'll try to poke at this myself sometime soon: want to make sure everything works in the new world and in the old one.
How are you building the example, and on what git revision? On the latest main branch, if I run cargo build --features=v2 --target=thumbv7em-none-eabihf
in examples/v2-speaker
it builds fine.
I came from the Rust Embedded Discovery Book which uses version 0.12.0
throughout their book and proceeded to work on examples with that version. After removing the Cargo.lock
file and bumping the microbit-v2
version to 0.14.0
the build runs fine.
Looking at the history for 0.12.0
, examples/v2-speaker
was still using use microbit::hal::prelude::OutputPin;
. I'm guessing that as of the Update to latest HAL crates, the issue I was running into was fixed.
My apologies, that's my bad as I should have looked more at which version I was using to build.
When building the
v2-speaker
example I am receiving both a warning and error related toOutputPin
.On line 43 I am receiving the error:
no method named 'set_low' found for struct 'P0_00' in the current scope
, as well as, an unused import forI was able to fix this error by removing the
embedded_hal
import and replacing it with:if this is indeed an error in the example code I'm happy to open up a PR for the change.