From 6b72ffff0ab0b09a5f42c150539f2a96903ee5ac Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Wed, 28 Feb 2024 14:18:07 +0000 Subject: [PATCH] Update to esp-hal unified, read => read_volatile on uart fifo --- Cargo.lock | 348 +++++++++++--------------------------- Cargo.toml | 22 +-- src/io/uart.rs | 2 +- src/io/usb_serial_jtag.rs | 3 +- src/lib.rs | 18 +- src/protocol.rs | 4 +- 6 files changed, 111 insertions(+), 286 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d08cd4..bebf65c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,19 +75,13 @@ checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" [[package]] name = "basic-toml" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" +checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" dependencies = [ "serde", ] -[[package]] -name = "bit_field" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" - [[package]] name = "bitfield" version = "0.14.0" @@ -96,9 +90,9 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "byteorder" @@ -142,9 +136,9 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "darling" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -152,78 +146,60 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] -name = "downcast" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" - -[[package]] -name = "either" -version = "1.9.0" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "embassy-executor" -version = "0.4.0" +name = "document-features" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94598b92a396f27bd34a4ce2648c35d5fec7c7157c1a4e3160167ca39c3e116c" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" dependencies = [ - "critical-section", - "embassy-executor-macros", - "embassy-time", + "litrs", ] [[package]] -name = "embassy-executor-macros" -version = "0.4.0" +name = "downcast" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab0f725ba52827eb44be22c85c52614c7402045968b26349de7f9df8421f74f" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.42", -] +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] -name = "embassy-time" -version = "0.2.0" +name = "either" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a2fc78331899dc7ba8fbcae2fcac3f5cd5301c0717689c546af2ce4162d4e4" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0-rc.2", - "embedded-hal-async", - "futures-util", - "heapless 0.8.0", -] +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "embedded-dma" @@ -246,18 +222,9 @@ dependencies = [ [[package]] name = "embedded-hal" -version = "1.0.0-rc.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e57ec6ad0bc8eb967cf9c9f144177f5e8f2f6f02dad0b8b683f9f05f6b22def" - -[[package]] -name = "embedded-hal-async" -version = "1.0.0-rc.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5ad4a01f9cb38117ef85f5cd32176d63875e7eab99c5b60e8492bfdc16dd63" -dependencies = [ - "embedded-hal 1.0.0-rc.2", -] +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" [[package]] name = "enum-as-inner" @@ -289,7 +256,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] @@ -309,17 +276,16 @@ dependencies = [ ] [[package]] -name = "esp-hal-common" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e9f181669edeb35ef6d6c5518c9941900dbf2133348673eebb4b33fb73ac62" +name = "esp-hal" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal#12176dbfffb4f8dd7aa89ffb8f74574e4a9c2545" dependencies = [ "basic-toml", "bitfield", "bitflags", "cfg-if", "critical-section", - "embassy-executor", + "document-features", "embedded-dma", "embedded-hal 0.2.7", "enumset", @@ -331,13 +297,15 @@ dependencies = [ "esp32c3", "esp32c6", "esp32h2", + "esp32p4", "esp32s2", "esp32s3", "fugit", - "heapless 0.8.0", "nb 1.1.0", "paste", "portable-atomic", + "rand_core", + "riscv", "serde", "strum 0.25.0", "usb-device", @@ -349,24 +317,24 @@ dependencies = [ [[package]] name = "esp-hal-procmacros" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4614e76646736f8adf18133d82d51f0da2b8899f38efb0a703b996a252b15e" +source = "git+https://github.com/esp-rs/esp-hal#12176dbfffb4f8dd7aa89ffb8f74574e4a9c2545" dependencies = [ "darling", + "document-features", "litrs", "object", "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] name = "esp-riscv-rt" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df05a8021fb80398c592703d180a6c31ec1dc050a6fb5b64c48c34d93caebc7e" +checksum = "f8c734d963f250000961ffcb6135d814a3be0456020fe54f06d71c4277769326" dependencies = [ "riscv", "riscv-rt-macros", @@ -388,153 +356,85 @@ dependencies = [ [[package]] name = "esp32" version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc2fc55374d01cd02af1ce27c75cd0607294aaa7b2ea67f1ff5f81a8924a2348" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ "critical-section", "vcell", "xtensa-lx", ] -[[package]] -name = "esp32-hal" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1a4dd97ac2ea1572434d5353a6bdeb86072d7864f9018221e7a04b5aa52689" -dependencies = [ - "esp-hal-common", -] - [[package]] name = "esp32c2" version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad287b8cbc78f61fa7c81202e8bb7b1e438715ca0dc9654fc5c326458e9ba5d" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ "critical-section", "vcell", ] -[[package]] -name = "esp32c2-hal" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f77e096cff195cac9f9a60ffac8e638abd17c8c6fdeb2ba5bb777c24535677" -dependencies = [ - "esp-hal-common", -] - [[package]] name = "esp32c3" version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398875eca3b0a51216110bd988bc72f79e564a0039fc93d81c10113c3e5f1a55" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ "critical-section", "vcell", ] -[[package]] -name = "esp32c3-hal" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22309e9d09d5b8df55a4ad915ea06fcec7b953815184cabbf97b64adc4398279" -dependencies = [ - "cfg-if", - "esp-hal-common", -] - [[package]] name = "esp32c6" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683d47088fa94123072f0d8fc6dbdad0ecd2fb013d2095170179a5bec4e09d2" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ "critical-section", "vcell", ] -[[package]] -name = "esp32c6-hal" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b706047d4abbf68374bfbab7492fd6c00ee30cb7166f20fb560cf28515f68e9e" -dependencies = [ - "esp-hal-common", -] - [[package]] name = "esp32h2" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cb744fe4793cf793355162551bbee5a1e07cb121004931e02847a6059b2c51" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ "critical-section", "vcell", ] [[package]] -name = "esp32h2-hal" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5485fa877e0b3170cef7e4cc43a6ef6f3064fe30ec42908005e2d47ae69e5e" +name = "esp32p4" +version = "0.1.0" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ - "esp-hal-common", + "critical-section", + "vcell", ] [[package]] name = "esp32s2" version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b31f5a118f20eac1f38d155432ad976b777229dbaf050fecf1d1a61cf3295a" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ "critical-section", "vcell", "xtensa-lx", ] -[[package]] -name = "esp32s2-hal" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf767fdb17ec7fda343bb0a53dae4d635820ba5752010cdd993041abc8b6bc" -dependencies = [ - "esp-hal-common", -] - [[package]] name = "esp32s3" version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5227feb6445b9eb8482f0a3eca3a0891df21a18b3d1c6e45fa6f09a5267b9711" +source = "git+https://github.com/esp-rs/esp-pacs?rev=bbf7d5a#bbf7d5a7dcc94ca974bdfaa64fac25a2814ad070" dependencies = [ "critical-section", "vcell", "xtensa-lx", ] -[[package]] -name = "esp32s3-hal" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3482d4659b1cdda54247ac60e6f10cd2365a65c7984e86ef6fdbdb144b66979c" -dependencies = [ - "esp-hal-common", -] - [[package]] name = "flasher-stub" version = "0.2.0" dependencies = [ "assert2", "critical-section", - "esp32-hal", - "esp32c2-hal", - "esp32c3-hal", - "esp32c6-hal", - "esp32h2-hal", - "esp32s2-hal", - "esp32s3-hal", + "esp-hal", "heapless 0.8.0", "matches", "mockall", @@ -573,30 +473,6 @@ dependencies = [ "gcd", ] -[[package]] -name = "futures-core" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" - -[[package]] -name = "futures-task" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" - -[[package]] -name = "futures-util" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", -] - [[package]] name = "gcd" version = "2.3.0" @@ -789,7 +665,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] @@ -801,7 +677,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] @@ -842,14 +718,14 @@ checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "flate2", "memchr", @@ -862,18 +738,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "portable-atomic" version = "1.6.0" @@ -912,11 +776,10 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_datetime", "toml_edit", ] @@ -946,18 +809,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -974,6 +837,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a" +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + [[package]] name = "regex" version = "1.10.2" @@ -1005,20 +874,19 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "riscv" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa3145d2fae3778b1e31ec2e827b228bdc6abd9b74bb5705ba46dcb82069bc4f" +checksum = "2f5c1b8bf41ea746266cdee443d1d1e9125c86ce1447e1a2615abd34330d33a9" dependencies = [ - "bit_field", "critical-section", - "embedded-hal 0.2.7", + "embedded-hal 1.0.0", ] [[package]] name = "riscv-rt-macros" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38509d7b17c2f604ceab3e5ff8ac97bb8cd2f544688c512be75c715edaf4daf" +checksum = "a8d100d466dbb76681ef6a9386f3da9abc570d57394e86da0ba5af8c4408486d" dependencies = [ "proc-macro2", "quote", @@ -1055,12 +923,12 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ruzstd" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" dependencies = [ "byteorder", - "thiserror-core", + "derive_more", "twox-hash", ] @@ -1078,22 +946,22 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] @@ -1170,7 +1038,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] @@ -1186,9 +1054,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.42" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", @@ -1201,37 +1069,17 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" -[[package]] -name = "thiserror-core" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" -dependencies = [ - "thiserror-core-impl", -] - -[[package]] -name = "thiserror-core-impl" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.42", -] - [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", @@ -1426,9 +1274,9 @@ dependencies = [ [[package]] name = "xtensa-lx" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9490addc0a1edd86e571a9ed8063f33d8224f981e61bbf72279671ed0cb4bb7c" +checksum = "e758f94e1a1f71758f94052a2766dcb12604998eb372b8b2e30576e3ab1ba1e6" dependencies = [ "bare-metal", "mutex-trait", @@ -1457,7 +1305,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.51", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bbb8223..25082f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,13 +8,7 @@ categories = ["embedded", "no-std"] [dependencies] critical-section = "1.1.2" -esp32-hal = { version = "0.17.0", optional = true } -esp32c2-hal = { version = "0.12.0", optional = true } -esp32c3-hal = { version = "0.14.0", optional = true } -esp32c6-hal = { version = "0.7.0", optional = true } -esp32h2-hal = { version = "0.5.0", optional = true } -esp32s2-hal = { version = "0.14.0", optional = true } -esp32s3-hal = { version = "0.14.0", optional = true } +esp-hal = { git = "https://github.com/esp-rs/esp-hal" } heapless = { version = "0.8.0", default-features = false } static_cell = "2.0.0" @@ -25,13 +19,13 @@ mockall = "0.12.1" mockall_double = "0.3.1" [features] -esp32 = ["esp32-hal"] -esp32c2 = ["esp32c2-hal"] -esp32c3 = ["esp32c3-hal"] -esp32c6 = ["esp32c6-hal"] -esp32h2 = ["esp32h2-hal"] -esp32s2 = ["esp32s2-hal"] -esp32s3 = ["esp32s3-hal"] +esp32 = ["esp-hal/esp32"] +esp32c2 = ["esp-hal/esp32c2"] +esp32c3 = ["esp-hal/esp32c3"] +esp32c6 = ["esp-hal/esp32c6"] +esp32h2 = ["esp-hal/esp32h2"] +esp32s2 = ["esp-hal/esp32s2"] +esp32s3 = ["esp-hal/esp32s3"] dprint = [] [profile.release] diff --git a/src/io/uart.rs b/src/io/uart.rs index 512a1d1..02d5d10 100644 --- a/src/io/uart.rs +++ b/src/io/uart.rs @@ -37,7 +37,7 @@ fn UART0() { // the read _must_ be a word read so the hardware correctly detects the read and // pops the byte from the fifo cast the result to a u8, as only the // first byte contains the data - let data = unsafe { uart.fifo().as_ptr().offset(offset / 4).read() } as u8; + let data = unsafe { uart.fifo().as_ptr().offset(offset / 4).read_volatile() } as u8; unsafe { RX_QUEUE.push_back(data).unwrap() }; } diff --git a/src/io/usb_serial_jtag.rs b/src/io/usb_serial_jtag.rs index 0606c5b..c01be9d 100644 --- a/src/io/usb_serial_jtag.rs +++ b/src/io/usb_serial_jtag.rs @@ -25,8 +25,7 @@ impl UsbSerialJtagMarker for UsbSerialJtag<'_> {} #[interrupt] unsafe fn USB_DEVICE() { - let usj = USB_DEVICE::steal(); - let reg_block = usj.register_block(); + let reg_block = USB_DEVICE::register_block(); while reg_block .ep1_conf() diff --git a/src/lib.rs b/src/lib.rs index 3687134..4ebcba9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,23 +23,7 @@ pub mod miniz_types; pub mod protocol; pub mod targets; -// Re-export the correct HAL based on which feature is active -pub mod hal { - #[cfg(feature = "esp32")] - pub use esp32_hal::*; - #[cfg(feature = "esp32c2")] - pub use esp32c2_hal::*; - #[cfg(feature = "esp32c3")] - pub use esp32c3_hal::*; - #[cfg(feature = "esp32c6")] - pub use esp32c6_hal::*; - #[cfg(feature = "esp32h2")] - pub use esp32h2_hal::*; - #[cfg(feature = "esp32s2")] - pub use esp32s2_hal::*; - #[cfg(feature = "esp32s3")] - pub use esp32s3_hal::*; -} +pub use esp_hal as hal; use self::{ hal::{peripherals::UART0, Uart}, diff --git a/src/protocol.rs b/src/protocol.rs index 19fa8b9..068c9a8 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -1,4 +1,4 @@ -use core::{cmp::min, mem::size_of, slice}; +use core::{cmp::min, mem::size_of, ptr::addr_of_mut, slice}; use slip::*; @@ -266,7 +266,7 @@ impl Stub { static mut DECOMPRESS_INDEX: usize = 0; let mut out_index = unsafe { DECOMPRESS_INDEX }; - let out_buf = unsafe { &mut DECOMPRESS_BUF }; + let out_buf = unsafe { &mut *addr_of_mut!(DECOMPRESS_BUF) }; let mut in_index = 0; let mut length = data.len(); let mut status = NeedsMoreInput;