From 5397c2807cbf3dd1caea229fa07254f7914c4f32 Mon Sep 17 00:00:00 2001 From: Anton Berneving <40672068+antbern@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:31:14 +0200 Subject: [PATCH] chore: bump `rp-hal` to `v0.9` and run `cargo update` (#120) --- slamrs-robot-rtic/firmware/Cargo.lock | 394 +++++++++--------- slamrs-robot-rtic/firmware/Cargo.toml | 23 +- slamrs-robot-rtic/firmware/src/encoder.rs | 2 +- slamrs-robot-rtic/firmware/src/main.rs | 25 +- slamrs-robot-rtic/firmware/src/motor.rs | 29 +- slamrs-robot-rtic/firmware/src/tasks/esp.rs | 11 +- .../firmware/src/tasks/heartbeat.rs | 9 +- .../firmware/src/tasks/motors.rs | 14 +- slamrs-robot-rtic/firmware/src/tasks/neato.rs | 10 +- slamrs-robot-rtic/firmware/src/tasks/usb.rs | 2 +- slamrs-robot-rtic/firmware/src/ws2812b.rs | 3 +- slamrs-robot-rtic/library/Cargo.lock | 33 +- slamrs-robot-rtic/library/Cargo.toml | 4 +- slamrs-robot-rtic/library/src/neato.rs | 4 +- slamrs-robot-rtic/library/src/parse_at.rs | 12 +- 15 files changed, 284 insertions(+), 291 deletions(-) diff --git a/slamrs-robot-rtic/firmware/Cargo.lock b/slamrs-robot-rtic/firmware/Cargo.lock index 0268bbe..3e900bd 100644 --- a/slamrs-robot-rtic/firmware/Cargo.lock +++ b/slamrs-robot-rtic/firmware/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" @@ -99,6 +99,12 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + [[package]] name = "bitflags" version = "1.3.2" @@ -107,21 +113,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cfg-if" @@ -146,16 +152,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" dependencies = [ "bare-metal 0.2.5", - "bitfield", + "bitfield 0.13.2", "embedded-hal 0.2.7", "volatile-register", ] [[package]] name = "cortex-m-rt" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2722f5b7d6ea8583cffa4d247044e280ccbb9fe501bed56552e2ba48b02d5f3d" +checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" dependencies = [ "cortex-m-rt-macros", ] @@ -182,9 +188,9 @@ dependencies = [ [[package]] name = "critical-section" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" +checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" [[package]] name = "crunchy" @@ -200,9 +206,9 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3939552907426de152b3c2c6f51ed53f98f448babd26f28694c95f5906194595" +checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -210,15 +216,15 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bdc7a7b92ac413e19e95240e75d3a73a8d8e78aa24a594c22cbb4d44b4bbda" +checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" dependencies = [ "defmt-parser", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.75", ] [[package]] @@ -232,9 +238,9 @@ dependencies = [ [[package]] name = "defmt-rtt" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "609923761264dd99ed9c7d209718cda4631c5fe84668e0f0960124cbb844c49f" +checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" dependencies = [ "critical-section", "defmt", @@ -269,9 +275,9 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embedded-dma" @@ -318,6 +324,22 @@ dependencies = [ "embedded-hal-async", ] +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "ena" version = "0.14.3" @@ -327,12 +349,6 @@ dependencies = [ "log", ] -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - [[package]] name = "equivalent" version = "1.0.1" @@ -341,9 +357,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fixed" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc715d38bea7b5bf487fcd79bcf8c209f0b58014f3018a7a19c2b855f472048" +checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" dependencies = [ "az", "bytemuck", @@ -381,7 +397,7 @@ checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.60", + "syn 2.0.75", ] [[package]] @@ -393,7 +409,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.75", ] [[package]] @@ -449,7 +465,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.75", ] [[package]] @@ -532,15 +548,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown", @@ -548,13 +564,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -599,17 +615,17 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.154" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "library" version = "0.1.0" dependencies = [ "defmt", - "embedded-hal 0.2.7", - "nb 0.1.3", + "embedded-hal-nb", + "nb 1.1.0", "slamrs-message", ] @@ -619,7 +635,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -635,15 +651,28 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "maybe-async-cfg" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a1e083394889336bc66a4eaf1011ffbfa74893e910f902a9f271fa624c61e1b2" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "pulldown-cmark", + "quote", + "syn 1.0.109", +] [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "nb" @@ -694,9 +723,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "panic-probe" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa6fa5645ef5a760cd340eaa92af9c1ce131c8c09e7f8926d8a24b59d26652b9" +checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" dependencies = [ "cortex-m", "defmt", @@ -704,9 +733,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -727,9 +756,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" @@ -804,9 +833,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "precomputed-hash" @@ -840,20 +869,32 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] +[[package]] +name = "pulldown-cmark" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4e75767fbc9d92b90e4d0c011f61358cde9513b31ef07ea3631b15ffc3b4fd" +dependencies = [ + "bitflags 2.6.0", + "memchr", + "unicase", +] + [[package]] name = "pwm-pca9685" -version = "0.3.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38528c196e50b4bd747634780749dbe4f67f476e03293ccf1c4f324726d8387" +checksum = "3ce0825d351aa10d61108df56029d6a34c52050019780f0f550b1df1b0ce5906" dependencies = [ - "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "maybe-async-cfg", "nb 1.1.0", ] @@ -874,18 +915,18 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -894,25 +935,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -923,15 +964,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rp-pico" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6341771e6f8e5d130b2b3cbc23435b7847761adf198af09f4b2a60407d43bd56" +checksum = "b9342d3ac7011ac688300979e9b52a81f0add1d05feb02868cf94bfee0705b28" dependencies = [ "cortex-m-rt", "fugit", @@ -951,14 +992,19 @@ dependencies = [ [[package]] name = "rp2040-hal" -version = "0.9.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff2b9ae7e6dd6720fd9f64250c9087260e50fe98b6b032ccca65be3581167ca" +checksum = "d11e711940087f2cdff8aeae9f4b902e2014c06a00b39a1092686b81ec973d6f" dependencies = [ + "bitfield 0.14.0", "cortex-m", "critical-section", "embedded-dma", "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", "frunk", "fugit", "itertools", @@ -987,9 +1033,9 @@ dependencies = [ [[package]] name = "rp2040-pac" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d9d8375815f543f54835d01160d4e47f9e2cae75f17ff8f1ec19ce1da96e4c" +checksum = "83cbcd3f7a0ca7bbe61dc4eb7e202842bee4e27b769a7bf3a4a72fa399d6e404" dependencies = [ "cortex-m", "cortex-m-rt", @@ -1036,20 +1082,19 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.75", ] [[package]] name = "rtic-monotonics" -version = "1.5.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058c2397dbd5bb4c5650a0e368c3920953e458805ff5097a0511b8147b3619d7" +checksum = "4e17f88319061d17d3b99997263397b176e3260177e2b4ff4ffed0078d97894c" dependencies = [ - "atomic-polyfill", "cfg-if", "cortex-m", - "embedded-hal 1.0.0", "fugit", + "portable-atomic", "rp2040-pac", "rtic-time", ] @@ -1071,11 +1116,14 @@ dependencies = [ [[package]] name = "rtic-time" -version = "1.3.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b232e7aebc045cfea81cdd164bc2727a10aca9a4568d406d0a5661cdfd0f19" +checksum = "a7b1d853fa50dc125695414ce4510567a0d420221e455b1568cfa8c9aece9614" dependencies = [ "critical-section", + "embedded-hal 1.0.0", + "embedded-hal-async", + "fugit", "futures-util", "rtic-common", ] @@ -1091,9 +1139,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "scopeguard" @@ -1116,26 +1164,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "serde" -version = "1.0.201" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.201" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "siphasher" version = "0.3.11" @@ -1158,11 +1186,10 @@ dependencies = [ "cortex-m-rt", "defmt", "defmt-rtt", - "embedded-hal 0.2.7", + "embedded-hal 1.0.0", "fixed", "futures", "library", - "nb 0.1.3", "panic-probe", "pio", "pio-proc", @@ -1172,7 +1199,6 @@ dependencies = [ "rtic-monotonics", "rtic-sync", "usb-device", - "usbd-hid", "usbd-serial", ] @@ -1182,16 +1208,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "ssmarshal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" -dependencies = [ - "encode_unicode", - "serde", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1224,9 +1240,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", @@ -1255,22 +1271,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.75", ] [[package]] @@ -1288,6 +1304,15 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-ident" version = "1.0.12" @@ -1296,65 +1321,35 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "usb-device" -version = "0.2.9" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6cc3adc849b5292b4075fc0d5fdcf2f24866e88e336dd27a8943090a520508" - -[[package]] -name = "usbd-hid" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "183b7e65bbd75512aedf250deda89394c74ae3118b79fe41f159e8503e1d5d7f" -dependencies = [ - "serde", - "ssmarshal", - "usb-device", - "usbd-hid-macros", -] - -[[package]] -name = "usbd-hid-descriptors" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbee8c6735e90894fba04770bc41e11fd3c5256018856e15dc4dd1e6c8a3dd1" -dependencies = [ - "bitfield", -] - -[[package]] -name = "usbd-hid-macros" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bd005b3aa54e62905d99df49a75d11888bb958eb780adb5e8f2029733077df" +checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "byteorder", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", - "usbd-hid-descriptors", + "heapless", + "portable-atomic", ] [[package]] name = "usbd-serial" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db75519b86287f12dcf0d171c7cf4ecc839149fe9f3b720ac4cfce52959e1dfe" +checksum = "065e4eaf93db81d5adac82d9cef8f8da314cb640fa7f89534b972383f1cf80fc" dependencies = [ "embedded-hal 0.2.7", - "nb 0.1.3", + "embedded-io", + "nb 1.1.0", "usb-device", ] @@ -1366,9 +1361,9 @@ checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "virtue" @@ -1415,11 +1410,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -1437,11 +1432,20 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1455,48 +1459,48 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/slamrs-robot-rtic/firmware/Cargo.toml b/slamrs-robot-rtic/firmware/Cargo.toml index 0b258e6..7a3f3b3 100644 --- a/slamrs-robot-rtic/firmware/Cargo.toml +++ b/slamrs-robot-rtic/firmware/Cargo.toml @@ -11,30 +11,27 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } -# embedded-hal = "1.0.0" -embedded-hal = "0.2.7" +embedded-hal = "1.0.0" # embedded-hal-async = "1.0.0" -# embedded-io = "0.6.1" +# embedded-io = "0.6" # embedded-io-async = "0.6.1" -# +# nb = "1.1" + cortex-m = { version = "0.7" } cortex-m-rt = "0.7" -rtic = { version = "2.0.0", features = [ "thumbv6-backend" ] } +rtic = { version = "2.1", features = [ "thumbv6-backend" ] } # portable-atomic = {version = "1.6.0", features=["critical-section"]} -rp-pico = "0.8" -rtic-monotonics = { version = "1.5", features = ["rp2040"] } +rp-pico = "0.9" +rtic-monotonics = { version = "2", features = ["rp2040"] } rtic-sync = "1.3" -# nb= { version = "1.0", features = ["defmt-0-3"]} -nb = "0.1.3" futures = { version = "0.3", default-features = false, features = ["async-await"] } # for usb serial connection (update when the hal is updated) -usb-device = "0.2" -usbd-hid = "0.5.0" -usbd-serial = "0.1" +usb-device = "0.3" +usbd-serial = "0.2" -pwm-pca9685 = "0.3" +pwm-pca9685 = "1.0" pio-proc = "0.2" pio = "0.2" diff --git a/slamrs-robot-rtic/firmware/src/encoder.rs b/slamrs-robot-rtic/firmware/src/encoder.rs index 7963a85..61eb627 100644 --- a/slamrs-robot-rtic/firmware/src/encoder.rs +++ b/slamrs-robot-rtic/firmware/src/encoder.rs @@ -97,7 +97,7 @@ fn initialize< program: InstalledProgram, target: Target, ) { - let (mut sm, pio_rx, _tx) = PIOBuilder::from_program(program) + let (mut sm, pio_rx, _tx) = PIOBuilder::from_installed_program(program) .in_pin_base(pin_in_a.num) .autopush(false) .push_threshold(32) diff --git a/slamrs-robot-rtic/firmware/src/main.rs b/slamrs-robot-rtic/firmware/src/main.rs index a83ae0c..cf6912c 100644 --- a/slamrs-robot-rtic/firmware/src/main.rs +++ b/slamrs-robot-rtic/firmware/src/main.rs @@ -11,6 +11,10 @@ mod ws2812b; use defmt_rtt as _; use panic_probe as _; +use rtic_monotonics::rp2040::prelude::*; + +rp2040_timer_monotonic!(Mono); + #[rtic::app( device = rp_pico::hal::pac, // Replace the `FreeInterrupt1, ...` with free interrupt vectors if software tasks are used @@ -29,8 +33,8 @@ mod app { use crate::util::channel_send; use core::sync::atomic::Ordering; - use defmt::{debug, error, info, warn}; - use embedded_hal::digital::v2::OutputPin; + use defmt::{error, info, warn}; + use embedded_hal::digital::OutputPin; use futures::FutureExt; use library::event::Event; use library::neato::RunningParser; @@ -49,7 +53,7 @@ mod app { Clock, }; use rp_pico::XOSC_CRYSTAL_FREQ; - use rtic_monotonics::rp2040::*; + use rtic_monotonics::Monotonic; use rtic_sync::portable_atomic::AtomicU8; // USB Device support @@ -211,9 +215,8 @@ mod app { // TODO setup monotonic if used // Initialize the interrupt for the RP2040 timer and obtain the token // proving that we have. - let rp2040_timer_token = rtic_monotonics::create_rp2040_monotonic_token!(); // Configure the clocks, watchdog - The default is to generate a 125 MHz system clock - Timer::start(ctx.device.TIMER, &mut ctx.device.RESETS, rp2040_timer_token); // default rp2040 clock-rate is 125MHz + crate::Mono::start(ctx.device.TIMER, &mut ctx.device.RESETS); // default rp2040 clock-rate is 125MHz let mut watchdog = Watchdog::new(ctx.device.WATCHDOG); let clocks = clocks::init_clocks_and_plls( XOSC_CRYSTAL_FREQ, @@ -289,9 +292,11 @@ mod app { // Create a USB device with a fake VID and PID let usb_dev = UsbDeviceBuilder::new(&bus_ref, UsbVidPid(0x16c0, 0x27dd)) - .manufacturer("Fake company") - .product("Serial port") - .serial_number("TEST") + .strings(&[StringDescriptors::default() + .manufacturer("Fake company") + .product("Serial port") + .serial_number("TEST")]) + .unwrap() .device_class(usbd_serial::USB_CLASS_CDC) .build(); @@ -311,7 +316,7 @@ mod app { let scl_pin: hal::gpio::Pin<_, hal::gpio::FunctionI2C, PullNone> = pins.gpio1.reconfigure(); // Create the I²C drive - let i2c = hal::I2C::i2c0( + let i2c = hal::I2C::i2c0_with_external_pull_up( ctx.device.I2C0, sda_pin, scl_pin, @@ -452,7 +457,7 @@ mod app { loop { futures::select_biased! { - _ = Timer::delay(1000.millis()).fuse() => { + _ = crate::Mono::delay(1000.millis()).fuse() => { if is_connected { // Send a ping message to the robot channel_send(cx.local.robot_message_sender, RobotMessage::Pong, "event_loop"); diff --git a/slamrs-robot-rtic/firmware/src/motor.rs b/slamrs-robot-rtic/firmware/src/motor.rs index cf5cc5c..c4edb23 100644 --- a/slamrs-robot-rtic/firmware/src/motor.rs +++ b/slamrs-robot-rtic/firmware/src/motor.rs @@ -1,10 +1,7 @@ //! Module for controling the motors through the Afafruit Featherwing Motor Driver -//! - -// embedded_hal::blocking::i2c: use core::marker::PhantomData; -use embedded_hal::blocking::i2c; +use embedded_hal::i2c; use pwm_pca9685::{Channel, Pca9685}; /// All possible errors @@ -64,12 +61,9 @@ pub struct Motor { pwm: Channel, } -impl MotorDriver -where - I2C: i2c::Write + i2c::WriteRead, -{ +impl MotorDriver { /// Create and initialize a new motor driver instance - pub fn new(i2c: I2C, address: u8, mut frequency_hz: f32) -> Result> { + pub fn new(i2c: I2C, address: u8, mut frequency_hz: f32) -> Result> { let mut pwm = Pca9685::new(i2c, address)?; // initialize the driver @@ -92,7 +86,7 @@ where } /// Get a motor instance - pub fn motor(&mut self, motor: MotorId) -> Result, Error> { + pub fn motor(&mut self, motor: MotorId) -> Result, Error> { // make sure the motor is not already taken if self.taken[motor.as_u8() as usize] { return Err(Error::MotorAlreadyTaken); @@ -117,12 +111,13 @@ where } } -impl Motor -where - I2C: i2c::Write + i2c::WriteRead, -{ +impl Motor { /// Set the speed of the motor - pub fn set_speed(&mut self, mc: &mut MotorDriver, speed: u16) -> Result<(), Error> { + pub fn set_speed( + &mut self, + mc: &mut MotorDriver, + speed: u16, + ) -> Result<(), Error> { mc.pwm.set_channel_on_off(self.pwm, 0, speed)?; Ok(()) } @@ -132,7 +127,7 @@ where &mut self, mc: &mut MotorDriver, speed: i16, - ) -> Result<(), Error> { + ) -> Result<(), Error> { let (direction, speed) = if speed > 0 { (MotorDirection::Forward, speed as u16) } else if speed < 0 { @@ -150,7 +145,7 @@ where &mut self, mc: &mut MotorDriver, direction: MotorDirection, - ) -> Result<(), Error> { + ) -> Result<(), Error> { match direction { MotorDirection::Forward => { mc.pwm.set_channel_on_off(self.in2, 0, 0)?; // take low first to avoid brake' diff --git a/slamrs-robot-rtic/firmware/src/tasks/esp.rs b/slamrs-robot-rtic/firmware/src/tasks/esp.rs index a066235..ef88b6a 100644 --- a/slamrs-robot-rtic/firmware/src/tasks/esp.rs +++ b/slamrs-robot-rtic/firmware/src/tasks/esp.rs @@ -1,5 +1,5 @@ use defmt::{error, info, warn}; -use embedded_hal::digital::v2::OutputPin; +use embedded_hal::digital::OutputPin; use futures::FutureExt; use library::{ event::Event, @@ -7,12 +7,13 @@ use library::{ }; use rp_pico::hal::fugit::ExtU64; use rtic::Mutex; -use rtic_monotonics::rp2040::Timer; +use rtic_monotonics::Monotonic; use crate::{ app::{init_esp, uart1_esp32, DATA_PACKET_SIZE}, tasks::heartbeat::{Color, LedStatus, Speed}, util::{channel_send, wait_for_message}, + Mono, }; /// Task that initializes and handles the ESP WIFI connection @@ -26,9 +27,9 @@ pub async fn init_esp(mut cx: init_esp::Context<'_>) { cx.local.esp_mode.set_high().ok(); cx.local.esp_reset.set_low().ok(); - Timer::delay(1.secs()).await; + Mono::delay(1.secs()).await; cx.local.esp_reset.set_high().ok(); - Timer::delay(1.secs()).await; + Mono::delay(1.secs()).await; // read messages from the device and advance the inner state machine @@ -97,7 +98,7 @@ pub async fn init_esp(mut cx: init_esp::Context<'_>) { info!("Enabling Multiple Connections"); cx.local.uart1_tx.write_full_blocking(b"AT+CIPMUX=1\r\n"); wait_for_message(cx.local.esp_receiver, EspMessage::Ok).await; - Timer::delay(1.secs()).await; + Mono::delay(1.secs()).await; cx.local .uart1_tx diff --git a/slamrs-robot-rtic/firmware/src/tasks/heartbeat.rs b/slamrs-robot-rtic/firmware/src/tasks/heartbeat.rs index eaf41fd..416cf63 100644 --- a/slamrs-robot-rtic/firmware/src/tasks/heartbeat.rs +++ b/slamrs-robot-rtic/firmware/src/tasks/heartbeat.rs @@ -1,8 +1,7 @@ -use crate::app::heartbeat; -use embedded_hal::digital::v2::ToggleableOutputPin; +use crate::{app::heartbeat, Mono}; use rp_pico::hal::fugit::ExtU64; use rtic::Mutex; -use rtic_monotonics::{rp2040::Timer, Monotonic}; +use rtic_monotonics::Monotonic; #[derive(defmt::Format, Copy, Clone)] pub enum Color { @@ -64,10 +63,10 @@ pub async fn heartbeat(mut cx: heartbeat::Context<'_>) { const SCALE: u8 = 4; // 10hz loop - let mut next_iteration_instant = Timer::now(); + let mut next_iteration_instant = Mono::now(); loop { next_iteration_instant += 100.millis(); - Timer::delay_until(next_iteration_instant).await; + Mono::delay_until(next_iteration_instant).await; let state = cx.shared.led_status.lock(|s| *s); diff --git a/slamrs-robot-rtic/firmware/src/tasks/motors.rs b/slamrs-robot-rtic/firmware/src/tasks/motors.rs index f9da2a1..1ba4143 100644 --- a/slamrs-robot-rtic/firmware/src/tasks/motors.rs +++ b/slamrs-robot-rtic/firmware/src/tasks/motors.rs @@ -1,9 +1,9 @@ -use crate::app::motor_control_loop; -use defmt::{info, warn}; +use crate::{app::motor_control_loop, Mono}; +use defmt::warn; use fixed::{types::extra::U16, FixedI32}; use rp_pico::hal::fugit::ExtU32; use rtic::Mutex; -use rtic_monotonics::{rp2040::Timer, Monotonic}; +use rtic_monotonics::Monotonic; /// The fixed point type used for the PI controller pub type F32 = FixedI32; @@ -19,14 +19,14 @@ pub async fn motor_control_loop(mut cx: motor_control_loop::Context<'_>) { let mut pi_right = PiController::new(); let mut pi_left = PiController::new(); - let mut next_iteration_instant = Timer::now(); + let mut next_iteration_instant = Mono::now(); loop { next_iteration_instant += CONTROL_LOOP_PERIOD_MS.millis(); - if next_iteration_instant < Timer::now() { + if next_iteration_instant < Mono::now() { warn!("Motor control loop is running behind"); - next_iteration_instant = Timer::now(); + next_iteration_instant = Mono::now(); } - Timer::delay_until(next_iteration_instant).await; + Mono::delay_until(next_iteration_instant).await; // do the actual control loop logic with a PI controller diff --git a/slamrs-robot-rtic/firmware/src/tasks/neato.rs b/slamrs-robot-rtic/firmware/src/tasks/neato.rs index ed7828d..be33e0f 100644 --- a/slamrs-robot-rtic/firmware/src/tasks/neato.rs +++ b/slamrs-robot-rtic/firmware/src/tasks/neato.rs @@ -1,14 +1,14 @@ use crate::{ app::{neato_motor_control, uart0_neato}, motor::MotorDirection, + Mono, }; use core::sync::atomic::{AtomicBool, AtomicU16, Ordering}; -use cortex_m::peripheral::dwt; -use defmt::{info, warn}; +use defmt::info; use library::slamrs_message::{RobotMessage, ScanFrame}; use rp_pico::hal::fugit::ExtU64; use rtic::Mutex; -use rtic_monotonics::rp2040::Timer; +use rtic_monotonics::Monotonic; /// Atomic variables to control the on/off state of the motor and the last measured RPM pub static MOTOR_ON: AtomicBool = AtomicBool::new(false); @@ -25,7 +25,7 @@ pub async fn neato_motor_control(mut cx: neato_motor_control::Context<'_>) { let mut pwm_current: i32 = 0; loop { - Timer::delay(200.millis()).await; + Mono::delay(200.millis()).await; let rpm_target = if MOTOR_ON.load(Ordering::Relaxed) { 300 @@ -61,6 +61,7 @@ pub async fn neato_motor_control(mut cx: neato_motor_control::Context<'_>) { // ); } } + pub fn uart0_neato(cx: uart0_neato::Context<'_>) { cx.local.parser.consume(cx.local.uart0_rx_neato, |data| { // some exponential smoothing on the raw (*64) RPM value @@ -73,6 +74,7 @@ pub fn uart0_neato(cx: uart0_neato::Context<'_>) { info!("neato rpm: {:?}", rpm); // TODO: should we add a data validation check? if rpm < 250 && rpm > 350 { + // THIS WILL NEVER BE TRUE LOL return; } diff --git a/slamrs-robot-rtic/firmware/src/tasks/usb.rs b/slamrs-robot-rtic/firmware/src/tasks/usb.rs index e3e6daa..b752757 100644 --- a/slamrs-robot-rtic/firmware/src/tasks/usb.rs +++ b/slamrs-robot-rtic/firmware/src/tasks/usb.rs @@ -1,5 +1,5 @@ use crate::{app::usb_irq, app::usb_sender, util::channel_send}; -use defmt::{info, warn}; +use defmt::warn; use library::event::Event; use rtic::mutex_prelude::*; use usb_device::prelude::*; diff --git a/slamrs-robot-rtic/firmware/src/ws2812b.rs b/slamrs-robot-rtic/firmware/src/ws2812b.rs index a638f33..55cbaa3 100644 --- a/slamrs-robot-rtic/firmware/src/ws2812b.rs +++ b/slamrs-robot-rtic/firmware/src/ws2812b.rs @@ -1,4 +1,3 @@ -use defmt::info; use rp_pico::{ hal::{ fugit::HertzU32, @@ -62,7 +61,7 @@ impl WS2812B { let (div_int, div_frac) = pio_calculate_clkdiv_from_float(div); // configure the state machine - let (mut sm, _rx, tx) = rp_pico::hal::pio::PIOBuilder::from_program(installed) + let (mut sm, _rx, tx) = rp_pico::hal::pio::PIOBuilder::from_installed_program(installed) .side_set_pin_base(pin.id().num) .clock_divisor_fixed_point(div_int, div_frac) .out_shift_direction(ShiftDirection::Left) diff --git a/slamrs-robot-rtic/library/Cargo.lock b/slamrs-robot-rtic/library/Cargo.lock index d30d234..e74eeca 100644 --- a/slamrs-robot-rtic/library/Cargo.lock +++ b/slamrs-robot-rtic/library/Cargo.lock @@ -58,12 +58,18 @@ dependencies = [ [[package]] name = "embedded-hal" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" dependencies = [ - "nb 0.1.3", - "void", + "embedded-hal", + "nb", ] [[package]] @@ -71,20 +77,11 @@ name = "library" version = "0.1.0" dependencies = [ "defmt", - "embedded-hal", - "nb 0.1.3", + "embedded-hal-nb", + "nb", "slamrs-message", ] -[[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" @@ -199,9 +196,3 @@ name = "virtue" version = "0.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" diff --git a/slamrs-robot-rtic/library/Cargo.toml b/slamrs-robot-rtic/library/Cargo.toml index 1c35eff..1c40805 100644 --- a/slamrs-robot-rtic/library/Cargo.toml +++ b/slamrs-robot-rtic/library/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" [dependencies] slamrs-message = { path = "../../slamrs-message" } -embedded-hal = "0.2" -nb = "0.1.3" +embedded-hal-nb = "1.0" +nb = "1.1" defmt = { version = "0.3", optional = true } diff --git a/slamrs-robot-rtic/library/src/neato.rs b/slamrs-robot-rtic/library/src/neato.rs index 92149f5..2e5e342 100644 --- a/slamrs-robot-rtic/library/src/neato.rs +++ b/slamrs-robot-rtic/library/src/neato.rs @@ -1,5 +1,3 @@ -use embedded_hal::serial::Read; - enum RunningParserState { LookingForStart { previous_byte: u8 }, CollectingBytes { index: usize }, @@ -22,7 +20,7 @@ impl RunningParser { state: RunningParserState::LookingForStart { previous_byte: 0 }, } } - pub fn consume>( + pub fn consume>( &mut self, reader: &mut R, mut callback: impl FnMut(NeatoFrame<'_>), diff --git a/slamrs-robot-rtic/library/src/parse_at.rs b/slamrs-robot-rtic/library/src/parse_at.rs index 5d88493..688f2f6 100644 --- a/slamrs-robot-rtic/library/src/parse_at.rs +++ b/slamrs-robot-rtic/library/src/parse_at.rs @@ -1,7 +1,5 @@ use core::str::FromStr; -use embedded_hal::serial::Read; - #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[derive(Debug, Clone, PartialEq)] pub enum ParsedMessage<'a> { @@ -88,7 +86,7 @@ impl AtParser { } } - pub fn consume>( + pub fn consume>( &mut self, reader: &mut R, callback: impl FnMut(ParsedMessage<'_>), @@ -228,6 +226,8 @@ pub fn parse_ipd<'a>(cmd: &'a [u8]) -> Result<(usize, &'a [u8]), &'static str> { mod tests { use std::vec::Vec; + use embedded_hal_nb::serial::Read; + use super::*; struct VecReader { @@ -250,9 +250,11 @@ mod tests { } } - impl embedded_hal::serial::Read for VecReader { - type Error = (); + impl embedded_hal_nb::serial::ErrorType for VecReader { + type Error = core::convert::Infallible; + } + impl embedded_hal_nb::serial::Read for VecReader { fn read(&mut self) -> nb::Result { if self.current_word < self.strings.len() { if self.current_byte >= self.strings[self.current_word].len() {