From 3f55fc4f50bffd051120023464acc9a04b24a802 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Fri, 11 Oct 2024 15:29:59 -0400 Subject: [PATCH] Update deps to modern versions (maybe?) --- harrogate/.cargo/config.toml | 4 + harrogate/Cargo.lock | 178 +++++++++++++++------------------ harrogate/Cargo.toml | 3 +- hello_gradient/Cargo.lock | 162 ++++++++++++++++++++++-------- itsybitsy_m0_lights/Cargo.toml | 5 +- itsybitsy_m0_lights/src/lib.rs | 51 +++------- rust-toolchain | 2 +- 7 files changed, 225 insertions(+), 180 deletions(-) diff --git a/harrogate/.cargo/config.toml b/harrogate/.cargo/config.toml index 0102016..e372867 100644 --- a/harrogate/.cargo/config.toml +++ b/harrogate/.cargo/config.toml @@ -4,6 +4,10 @@ target = "thumbv6m-none-eabi" [target.thumbv6m-none-eabi] runner = 'arm-none-eabi-gdb' rustflags = [ + # This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x + # See https://github.com/rust-embedded/cortex-m-quickstart/pull/95 + "-C", "link-arg=--nmagic", + # LLD (shipped with the Rust toolchain) is used as the default linker "-C", "link-arg=-Tlink.x", diff --git a/harrogate/Cargo.lock b/harrogate/Cargo.lock index fc18191..a818be8 100644 --- a/harrogate/Cargo.lock +++ b/harrogate/Cargo.lock @@ -1,15 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - -[[package]] -name = "aligned" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19796bd8d477f1a9d4ac2465b464a8b1359474f06a96bb3cda650b4fca309bf" -dependencies = [ - "as-slice", -] +version = 4 [[package]] name = "apa102-spi" @@ -21,47 +12,47 @@ dependencies = [ "smart-leds-trait", ] -[[package]] -name = "as-slice" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45403b49e3954a4b8428a0ac21a4b7afadccf92bfd96273f1a58cd4812496ae0" -dependencies = [ - "generic-array 0.12.4", - "generic-array 0.13.3", - "generic-array 0.14.4", - "stable_deref_trait", -] - [[package]] name = "atsamd-hal" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "868f22ff864d664efd9a0134cad0905d918f62f3b14d7761ca6d64bdcb1df96b" +checksum = "1cddc374559f476b8225083732b400544075c67616e1b1e1635b0efe84bef158" dependencies = [ "atsamd21g", "bitfield", - "cortex-m 0.6.7", + "bitflags", + "cortex-m", "embedded-hal", + "modular-bitfield", "nb 0.1.3", + "num-traits", "paste", "rand_core", + "replace_with", + "seq-macro", + "typenum", "vcell", "void", ] [[package]] name = "atsamd21g" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d4092551cf82644de22191ad79c734adbd88df8e2b861e7b614d7e7891c83c7" +checksum = "3dc9d19869bcd08caab8328a4dc4dc99d4f0216653d8d63963847a03ce87654c" dependencies = [ "bare-metal", - "cortex-m 0.6.7", + "cortex-m", "cortex-m-rt", "vcell", ] +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + [[package]] name = "bare-metal" version = "0.2.5" @@ -87,6 +78,12 @@ 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.7.0" @@ -95,22 +92,9 @@ checksum = "9966d2ab714d0f785dbac0a0396251a35280aeb42413281617d0209ab4898435" [[package]] name = "cortex-m" -version = "0.6.7" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9075300b07c6a56263b9b582c214d0ff037b00d45ec9fde1cc711490c56f1bb9" -dependencies = [ - "aligned", - "bare-metal", - "bitfield", - "cortex-m 0.7.3", - "volatile-register", -] - -[[package]] -name = "cortex-m" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac919ef424449ec8c08d515590ce15d9262c0ca5f0da5b0c901e971a3b783b3" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" dependencies = [ "bare-metal", "bitfield", @@ -120,19 +104,18 @@ dependencies = [ [[package]] name = "cortex-m-rt" -version = "0.6.14" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d8353767db816419630a76d5f1ad5b09610d22b67ceb59647df6a8abc667f8" +checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" dependencies = [ "cortex-m-rt-macros", - "r0", ] [[package]] name = "cortex-m-rt-macros" -version = "0.1.8" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717562afbba06e760d34451919f5c3bf3ac15c7bb897e8b04862a7428378647" +checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" dependencies = [ "proc-macro2", "quote", @@ -149,34 +132,6 @@ dependencies = [ "void", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "harrogate" version = "0.1.0" @@ -185,7 +140,6 @@ dependencies = [ "itsybitsy_m0", "itsybitsy_m0_lights", "lights", - "panic-halt", ] [[package]] @@ -197,17 +151,14 @@ dependencies = [ [[package]] name = "itsybitsy_m0" -version = "0.10.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5910604281fc0ab4d2cd7b1284443a1945615c99fde191baca60d6e097b2408c" +checksum = "ffb0011fc3680ff7529d992dca12746f3e324b2e42c52bccfeda97ff95f46ad2" dependencies = [ "apa102-spi", "atsamd-hal", "bitbang-hal", - "cortex-m 0.6.7", "cortex-m-rt", - "embedded-hal", - "nb 0.1.3", "smart-leds", ] @@ -215,8 +166,7 @@ dependencies = [ name = "itsybitsy_m0_lights" version = "0.1.0" dependencies = [ - "cortex-m 0.7.3", - "embedded-hal", + "cortex-m", "itsybitsy_m0", "lights", "panic-halt", @@ -226,6 +176,27 @@ dependencies = [ name = "lights" version = "0.1.0" +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "nb" version = "0.1.3" @@ -241,6 +212,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "panic-halt" version = "0.2.0" @@ -271,18 +251,18 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "r0" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f" - [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +[[package]] +name = "replace_with" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" + [[package]] name = "rgb" version = "0.8.27" @@ -316,6 +296,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "seq-macro" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9f47faea3cad316faa914d013d24f471cd90bfca1a0c70f05a3f42c6441e99" + [[package]] name = "smart-leds" version = "0.3.0" @@ -335,10 +321,10 @@ dependencies = [ ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" @@ -369,12 +355,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" -[[package]] -name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - [[package]] name = "void" version = "1.0.2" diff --git a/harrogate/Cargo.toml b/harrogate/Cargo.toml index b6bb288..129545c 100644 --- a/harrogate/Cargo.toml +++ b/harrogate/Cargo.toml @@ -34,7 +34,6 @@ door-light-orange = ["replace-default"] [dependencies] house = { path = "../house" } -itsybitsy_m0 = "0.10" +itsybitsy_m0 = "0.13.1" lights = { path = "../lights" } lights_hal = { path = "../itsybitsy_m0_lights", package = "itsybitsy_m0_lights" } -panic-halt = "0.2" diff --git a/hello_gradient/Cargo.lock b/hello_gradient/Cargo.lock index 8f6120d..289915b 100644 --- a/hello_gradient/Cargo.lock +++ b/hello_gradient/Cargo.lock @@ -50,30 +50,36 @@ dependencies = [ [[package]] name = "atsamd-hal" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "868f22ff864d664efd9a0134cad0905d918f62f3b14d7761ca6d64bdcb1df96b" +checksum = "1cddc374559f476b8225083732b400544075c67616e1b1e1635b0efe84bef158" dependencies = [ "atsamd21g", "bitfield", - "cortex-m 0.6.7", + "bitflags", + "cortex-m 0.7.7", "embedded-hal", + "modular-bitfield", "nb 0.1.3", - "paste 1.0.5", + "num-traits", + "paste 1.0.15", "rand_core", + "replace_with", + "seq-macro", + "typenum", "vcell", "void", ] [[package]] name = "atsamd21g" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d4092551cf82644de22191ad79c734adbd88df8e2b861e7b614d7e7891c83c7" +checksum = "3dc9d19869bcd08caab8328a4dc4dc99d4f0216653d8d63963847a03ce87654c" dependencies = [ "bare-metal", - "cortex-m 0.6.7", - "cortex-m-rt", + "cortex-m 0.7.7", + "cortex-m-rt 0.7.3", "vcell", ] @@ -85,10 +91,16 @@ checksum = "a5486b991ab0012b18f749e0b4bd71d882b4d6134dd58a1c16b571cf2e3d40eb" dependencies = [ "bare-metal", "cortex-m 0.6.7", - "cortex-m-rt", + "cortex-m-rt 0.6.14", "vcell", ] +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + [[package]] name = "bare-metal" version = "0.2.5" @@ -100,12 +112,12 @@ dependencies = [ [[package]] name = "bitbang-hal" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "470e1522d257e4c76245980d27d5d279442cb18955cc6341249b904074033f4a" +checksum = "8a6e78d48a099db1643b06824ea903b72c39b38ebc0e98ba5a6693d35f360a28" dependencies = [ "embedded-hal", - "nb 0.1.3", + "nb 1.0.0", ] [[package]] @@ -115,10 +127,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" [[package]] -name = "bytemuck" -version = "1.7.0" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966d2ab714d0f785dbac0a0396251a35280aeb42413281617d0209ab4898435" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bytemuck" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "cortex-m" @@ -129,15 +147,15 @@ dependencies = [ "aligned", "bare-metal", "bitfield", - "cortex-m 0.7.3", + "cortex-m 0.7.7", "volatile-register", ] [[package]] name = "cortex-m" -version = "0.7.3" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac919ef424449ec8c08d515590ce15d9262c0ca5f0da5b0c901e971a3b783b3" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" dependencies = [ "bare-metal", "bitfield", @@ -151,10 +169,19 @@ version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d8353767db816419630a76d5f1ad5b09610d22b67ceb59647df6a8abc667f8" dependencies = [ - "cortex-m-rt-macros", + "cortex-m-rt-macros 0.1.8", "r0", ] +[[package]] +name = "cortex-m-rt" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" +dependencies = [ + "cortex-m-rt-macros 0.7.0", +] + [[package]] name = "cortex-m-rt-macros" version = "0.1.8" @@ -167,10 +194,21 @@ dependencies = [ ] [[package]] -name = "embedded-hal" -version = "0.2.5" +name = "cortex-m-rt-macros" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db184d3fa27bc7a2344250394c0264144dfe0bc81a4401801dcb964b8dd172ad" +checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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", @@ -211,24 +249,21 @@ checksum = "1f00eb09c5591b0d404f671bc87d9e39120d558ea74025d367b28bb61acc9b10" dependencies = [ "atsamd-hal 0.7.4", "cortex-m 0.6.7", - "cortex-m-rt", + "cortex-m-rt 0.6.14", "embedded-hal", "nb 0.1.3", ] [[package]] name = "itsybitsy_m0" -version = "0.10.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5910604281fc0ab4d2cd7b1284443a1945615c99fde191baca60d6e097b2408c" +checksum = "ffb0011fc3680ff7529d992dca12746f3e324b2e42c52bccfeda97ff95f46ad2" dependencies = [ "apa102-spi", - "atsamd-hal 0.12.0", + "atsamd-hal 0.14.0", "bitbang-hal", - "cortex-m 0.6.7", - "cortex-m-rt", - "embedded-hal", - "nb 0.1.3", + "cortex-m-rt 0.7.3", "smart-leds", ] @@ -236,9 +271,8 @@ dependencies = [ name = "itsybitsy_m0_lights" version = "0.1.0" dependencies = [ - "cortex-m 0.7.3", - "embedded-hal", - "itsybitsy_m0 0.10.0", + "cortex-m 0.7.7", + "itsybitsy_m0 0.13.1", "lights", "panic-halt", ] @@ -247,6 +281,27 @@ dependencies = [ name = "lights" version = "0.1.0" +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "nb" version = "0.1.3" @@ -262,6 +317,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "panic-halt" version = "0.2.0" @@ -280,9 +344,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.5" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "paste-impl" @@ -338,10 +402,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" [[package]] -name = "rgb" -version = "0.8.27" +name = "replace_with" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fddb3b23626145d1776addfc307e1a1851f60ef6ca64f376bcb889697144cf0" +checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" + +[[package]] +name = "rgb" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" dependencies = [ "bytemuck", ] @@ -370,6 +440,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "seq-macro" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9f47faea3cad316faa914d013d24f471cd90bfca1a0c70f05a3f42c6441e99" + [[package]] name = "smart-leds" version = "0.3.0" @@ -394,6 +470,12 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "syn" version = "1.0.5" @@ -407,9 +489,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.11.2" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-xid" diff --git a/itsybitsy_m0_lights/Cargo.toml b/itsybitsy_m0_lights/Cargo.toml index 4a2ec9d..fbe66eb 100644 --- a/itsybitsy_m0_lights/Cargo.toml +++ b/itsybitsy_m0_lights/Cargo.toml @@ -5,8 +5,7 @@ authors = ["Tangent 128 "] edition = "2018" [dependencies] -cortex-m = { version = "0.7.1" } -embedded-hal = "0.2.5" -itsybitsy_m0 = "0.10" +cortex-m = { version = "0.7.7" } +itsybitsy_m0 = "0.13.1" lights = { path = "../lights" } panic-halt = "0.2" diff --git a/itsybitsy_m0_lights/src/lib.rs b/itsybitsy_m0_lights/src/lib.rs index 2888d1f..aca818d 100644 --- a/itsybitsy_m0_lights/src/lib.rs +++ b/itsybitsy_m0_lights/src/lib.rs @@ -1,40 +1,32 @@ #![no_std] -extern crate cortex_m; -extern crate embedded_hal; -extern crate itsybitsy_m0 as hal; -extern crate panic_halt; +use itsybitsy_m0::hal::gpio::v2::PushPullOutput; +use panic_halt as _; pub use cortex_m::asm::delay; -pub use hal::entry; use core::arch::asm; -use core::fmt::Debug; use core::sync::atomic::{compiler_fence, Ordering}; use core::u8; -pub use embedded_hal::digital::v2::OutputPin; -use hal::{clock::GenericClockController, pac::Peripherals}; +use hal::prelude::*; +pub use itsybitsy_m0::entry; +use itsybitsy_m0::hal as hal; use lights::{HardwareRgb, Lights}; -pub fn boot() -> NeopixelLights< - impl OutputPin, - impl OutputPin, - impl OutputPin, -> { - let mut peripherals = Peripherals::take().unwrap(); - let _clock = GenericClockController::with_internal_32kosc( +pub fn boot() -> NeopixelLights { + let mut peripherals = hal::pac::Peripherals::take().unwrap(); + let _clock = hal::clock::GenericClockController::with_internal_32kosc( peripherals.GCLK, &mut peripherals.PM, &mut peripherals.SYSCTRL, &mut peripherals.NVMCTRL, ); - let mut pins = hal::Pins::new(peripherals.PORT); + let pins = itsybitsy_m0::Pins::new(peripherals.PORT); NeopixelLights { - out: pins.d7.into_push_pull_output(&mut pins.port), - high_out: pins.d5.into_push_pull_output(&mut pins.port), - red_led: pins.d13.into_open_drain_output(&mut pins.port), + high_out: pins.d5.into(), + red_led: pins.d13.into(), debug_light: false, } } @@ -48,19 +40,13 @@ pub fn boot() -> NeopixelLights< const LATCH_CYCLES: u32 = 15000; // about 300us -pub struct NeopixelLights { - pub out: T, - pub high_out: U, - pub red_led: V, +pub struct NeopixelLights { + pub high_out: hal::gpio::v2::Pin, + pub red_led: itsybitsy_m0::RedLed, pub debug_light: bool, } -impl NeopixelLights -where - T::Error: Debug, - U::Error: Debug, - V::Error: Debug, -{ +impl NeopixelLights { #[inline] pub fn write(&mut self, bit: bool) { if bit { @@ -176,12 +162,7 @@ where } } -impl Lights for NeopixelLights -where - T::Error: Debug, - U::Error: Debug, - V::Error: Debug, -{ +impl Lights for NeopixelLights { type Pixel = HardwareRgb; #[inline] diff --git a/rust-toolchain b/rust-toolchain index bf867e0..2bf5ad0 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly +stable