nrf-rs / microbit

A Rust crate for BBC micro:bit development
BSD Zero Clause License
253 stars 60 forks source link

Modify imports for v2-speaker example #145

Closed a-camarillo closed 2 months ago

a-camarillo commented 2 months ago

When building the v2-speaker example I am receiving both a warning and error related to OutputPin.

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 for

 use embedded_hal::digital::OutputPin;

I was able to fix this error by removing the embedded_hal import and replacing it with:

use microbit::hal::prelude::OutputPin;

if this is indeed an error in the example code I'm happy to open up a PR for the change.

BartMassey commented 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.

a-camarillo commented 2 months ago

Here is the Cargo.lock with use embedded_hal::digital::OutputPin; and the build failing.

Before Cargo.lock ``` # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "az" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "bare-metal" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" dependencies = [ "rustc_version", ] [[package]] name = "bare-metal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" [[package]] name = "bitfield" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bytemuck" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cortex-m" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" dependencies = [ "bare-metal 0.2.5", "bitfield", "critical-section 1.1.2", "embedded-hal 0.2.7", "volatile-register", ] [[package]] name = "cortex-m-rt" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2722f5b7d6ea8583cffa4d247044e280ccbb9fe501bed56552e2ba48b02d5f3d" dependencies = [ "cortex-m-rt-macros", ] [[package]] name = "cortex-m-rt-macros" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] [[package]] name = "critical-section" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1706d332edc22aef4d9f23a6bb1c92360a403013c291af51247a737472dcae6" dependencies = [ "bare-metal 1.0.0", "critical-section 1.1.2", ] [[package]] name = "critical-section" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "defmt" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3939552907426de152b3c2c6f51ed53f98f448babd26f28694c95f5906194595" dependencies = [ "bitflags", "defmt-macros", ] [[package]] name = "defmt-macros" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18bdc7a7b92ac413e19e95240e75d3a73a8d8e78aa24a594c22cbb4d44b4bbda" dependencies = [ "defmt-parser", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.60", ] [[package]] name = "defmt-parser" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "609923761264dd99ed9c7d209718cda4631c5fe84668e0f0960124cbb844c49f" dependencies = [ "critical-section 1.1.2", "defmt", ] [[package]] name = "embedded-dma" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c8c02e4347a0267ca60813c952017f4c5948c232474c6010a381a337f1bda4" dependencies = [ "stable_deref_trait", ] [[package]] name = "embedded-hal" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" dependencies = [ "nb 0.1.3", "void", ] [[package]] name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" [[package]] name = "embedded-storage" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "723dce4e9f25b6e6c5f35628e144794e5b459216ed7da97b7c4b66cdb3fa82ca" [[package]] name = "fixed" version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fc715d38bea7b5bf487fcd79bcf8c209f0b58014f3018a7a19c2b855f472048" dependencies = [ "az", "bytemuck", "half", "typenum", ] [[package]] name = "half" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", ] [[package]] name = "microbit-common" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e73801aec4899e757c211ae31886ef1a518c05d34ab6ddf2b2c0b4ec449465a" dependencies = [ "embedded-hal 0.2.7", "nrf52833-hal", "tiny-led-matrix", ] [[package]] name = "microbit-v2" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cddfc92e0a8b1ab364e77eecbb2a667ea292b9af875c492af472ad895f84c5a" dependencies = [ "microbit-common", ] [[package]] name = "nb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" dependencies = [ "nb 1.1.0", ] [[package]] name = "nb" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] name = "nrf-hal-common" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd37b3fd039327b4005cc0d4ef20bce0a41bf521071774d5adb854e4b1230639" dependencies = [ "cast", "cfg-if", "cortex-m", "embedded-dma", "embedded-hal 0.2.7", "embedded-storage", "fixed", "nb 1.1.0", "nrf-usbd", "nrf52833-pac", "rand_core", "void", ] [[package]] name = "nrf-usbd" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "640e88d4c108743c667f03320d0c9ab24a20f183a7a1b18bde7891ee13fd92c5" dependencies = [ "bare-metal 1.0.0", "cortex-m", "critical-section 0.2.8", "usb-device", "vcell", ] [[package]] name = "nrf52833-hal" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f76d269c9a239ffe24edaa5ee0972b102c04e898b464e3e9a12ab0eacd5f76" dependencies = [ "embedded-hal 0.2.7", "nrf-hal-common", "nrf52833-pac", ] [[package]] name = "nrf52833-pac" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd69bdb25903e18e098c040ef31dc863814437af010dea8bd55aa31f686cb461" dependencies = [ "cortex-m", "cortex-m-rt", "vcell", ] [[package]] name = "panic-halt" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812" [[package]] name = "proc-macro-error" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", "syn 1.0.109", "version_check", ] [[package]] name = "proc-macro-error-attr" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", "version_check", ] [[package]] name = "proc-macro2" version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ "semver", ] [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ "semver-parser", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "speaker" version = "0.1.0" dependencies = [ "cortex-m", "cortex-m-rt", "defmt", "defmt-rtt", "embedded-hal 1.0.0", "microbit-v2", "panic-halt", ] [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "syn" version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "thiserror" version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", "syn 2.0.60", ] [[package]] name = "tiny-led-matrix" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a718c727b686154a7c7913f70d7ebc8956f701cbab466bc22035cb27f378882b" [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "usb-device" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f6cc3adc849b5292b4075fc0d5fdcf2f24866e88e336dd27a8943090a520508" [[package]] name = "vcell" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "volatile-register" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" dependencies = [ "vcell", ] ```

Here is the Cargo.lock with use microbit::hal::prelude::OutputPin; and the build succeeding.

After Cargo.lock ``` # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "az" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "bare-metal" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" dependencies = [ "rustc_version", ] [[package]] name = "bare-metal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" [[package]] name = "bitfield" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bytemuck" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cortex-m" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" dependencies = [ "bare-metal 0.2.5", "bitfield", "critical-section 1.1.2", "embedded-hal 0.2.7", "volatile-register", ] [[package]] name = "cortex-m-rt" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2722f5b7d6ea8583cffa4d247044e280ccbb9fe501bed56552e2ba48b02d5f3d" dependencies = [ "cortex-m-rt-macros", ] [[package]] name = "cortex-m-rt-macros" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] [[package]] name = "critical-section" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1706d332edc22aef4d9f23a6bb1c92360a403013c291af51247a737472dcae6" dependencies = [ "bare-metal 1.0.0", "critical-section 1.1.2", ] [[package]] name = "critical-section" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "defmt" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3939552907426de152b3c2c6f51ed53f98f448babd26f28694c95f5906194595" dependencies = [ "bitflags", "defmt-macros", ] [[package]] name = "defmt-macros" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18bdc7a7b92ac413e19e95240e75d3a73a8d8e78aa24a594c22cbb4d44b4bbda" dependencies = [ "defmt-parser", "proc-macro-error", "proc-macro2", "quote", "syn 2.0.60", ] [[package]] name = "defmt-parser" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "609923761264dd99ed9c7d209718cda4631c5fe84668e0f0960124cbb844c49f" dependencies = [ "critical-section 1.1.2", "defmt", ] [[package]] name = "embedded-dma" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c8c02e4347a0267ca60813c952017f4c5948c232474c6010a381a337f1bda4" dependencies = [ "stable_deref_trait", ] [[package]] name = "embedded-hal" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" dependencies = [ "nb 0.1.3", "void", ] [[package]] name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" [[package]] name = "embedded-storage" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "723dce4e9f25b6e6c5f35628e144794e5b459216ed7da97b7c4b66cdb3fa82ca" [[package]] name = "fixed" version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fc715d38bea7b5bf487fcd79bcf8c209f0b58014f3018a7a19c2b855f472048" dependencies = [ "az", "bytemuck", "half", "typenum", ] [[package]] name = "half" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", ] [[package]] name = "microbit-common" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e73801aec4899e757c211ae31886ef1a518c05d34ab6ddf2b2c0b4ec449465a" dependencies = [ "embedded-hal 0.2.7", "nrf52833-hal", "tiny-led-matrix", ] [[package]] name = "microbit-v2" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cddfc92e0a8b1ab364e77eecbb2a667ea292b9af875c492af472ad895f84c5a" dependencies = [ "microbit-common", ] [[package]] name = "nb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" dependencies = [ "nb 1.1.0", ] [[package]] name = "nb" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] name = "nrf-hal-common" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd37b3fd039327b4005cc0d4ef20bce0a41bf521071774d5adb854e4b1230639" dependencies = [ "cast", "cfg-if", "cortex-m", "embedded-dma", "embedded-hal 0.2.7", "embedded-storage", "fixed", "nb 1.1.0", "nrf-usbd", "nrf52833-pac", "rand_core", "void", ] [[package]] name = "nrf-usbd" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "640e88d4c108743c667f03320d0c9ab24a20f183a7a1b18bde7891ee13fd92c5" dependencies = [ "bare-metal 1.0.0", "cortex-m", "critical-section 0.2.8", "usb-device", "vcell", ] [[package]] name = "nrf52833-hal" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f76d269c9a239ffe24edaa5ee0972b102c04e898b464e3e9a12ab0eacd5f76" dependencies = [ "embedded-hal 0.2.7", "nrf-hal-common", "nrf52833-pac", ] [[package]] name = "nrf52833-pac" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd69bdb25903e18e098c040ef31dc863814437af010dea8bd55aa31f686cb461" dependencies = [ "cortex-m", "cortex-m-rt", "vcell", ] [[package]] name = "panic-halt" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812" [[package]] name = "proc-macro-error" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", "syn 1.0.109", "version_check", ] [[package]] name = "proc-macro-error-attr" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", "version_check", ] [[package]] name = "proc-macro2" version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ "semver", ] [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ "semver-parser", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "speaker" version = "0.1.0" dependencies = [ "cortex-m", "cortex-m-rt", "defmt", "defmt-rtt", "embedded-hal 1.0.0", "microbit-v2", "panic-halt", ] [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "syn" version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "thiserror" version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", "syn 2.0.60", ] [[package]] name = "tiny-led-matrix" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a718c727b686154a7c7913f70d7ebc8956f701cbab466bc22035cb27f378882b" [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "usb-device" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f6cc3adc849b5292b4075fc0d5fdcf2f24866e88e336dd27a8943090a520508" [[package]] name = "vcell" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "volatile-register" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" dependencies = [ "vcell", ] ```

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

BartMassey commented 2 months ago

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.

qwandor commented 2 months ago

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.

a-camarillo commented 2 months ago

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.